-
Notifications
You must be signed in to change notification settings - Fork 231
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 #838 from doctrine/5.0.x-merge-up-into-5.1.x_oewv85CN
Merge release 5.0.1 into 5.1.x
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Bundle\MongoDBBundle\Tests\Command; | ||
|
||
use Doctrine\Bundle\MongoDBBundle\Command\DoctrineODMCommand; | ||
use Doctrine\ODM\MongoDB\Tools\Console\Helper\DocumentManagerHelper; | ||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
|
||
class DoctrineODMCommandTest extends KernelTestCase | ||
{ | ||
/** @dataProvider provideDmName */ | ||
public function testSetApplicationManager(?string $dmName): void | ||
{ | ||
$kernel = new CommandTestKernel('test', false); | ||
$kernel->boot(); | ||
$application = new Application($kernel); | ||
|
||
DoctrineODMCommand::setApplicationDocumentManager($application, $dmName); | ||
|
||
$this->assertInstanceOf(DocumentManagerHelper::class, $application->getHelperSet()->get('dm')); | ||
} | ||
|
||
public static function provideDmName(): iterable | ||
{ | ||
yield ['command_test']; | ||
yield [null]; | ||
} | ||
} |