Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #285 from alcaeus/fix-deprecations
Fix deprecations in fixture command
- Loading branch information
Showing
3 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Bundle\FixturesBundle\Tests\Command; | ||
|
||
use Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand; | ||
use Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader; | ||
use Doctrine\Common\Persistence\ManagerRegistry; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\DependencyInjection\Container; | ||
|
||
class LoadDataFixturesDoctrineCommandTest extends TestCase | ||
{ | ||
/** | ||
* @group legacy | ||
* @expectedDeprecation The "Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand" constructor expects a "Doctrine\Common\Persistence\ManagerRegistry" instance as second argument, not passing it will throw a \TypeError in DoctrineFixturesBundle 4.0. | ||
*/ | ||
public function testInstantiatingWithoutManagerRegistry() : void | ||
{ | ||
$loader = new SymfonyFixturesLoader(new Container()); | ||
|
||
new LoadDataFixturesDoctrineCommand($loader); | ||
} | ||
|
||
/** | ||
* @doesNotPerformAssertions | ||
*/ | ||
public function testInstantiatingWithManagerRegistry() : void | ||
{ | ||
$registry = $this->createMock(ManagerRegistry::class); | ||
$loader = new SymfonyFixturesLoader(new Container()); | ||
|
||
new LoadDataFixturesDoctrineCommand($loader, $registry); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters