generated from ergebnis/php-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Show and validate Doctrine mapping information
- Loading branch information
1 parent
fb65c38
commit 10e4003
Showing
8 changed files
with
114 additions
and
29 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
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2020 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/ergebnis/factory-bot | ||
*/ | ||
|
||
use Doctrine\ORM; | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$filename = include __DIR__ . '/entity-manager.php'; | ||
|
||
$entityManager = $filename; | ||
|
||
if (!$entityManager instanceof ORM\EntityManagerInterface) { | ||
throw new \RuntimeException(\sprintf( | ||
'File "%s" should return an instance of "%s" that can be used in tests, but it does not.', | ||
$filename, | ||
ORM\EntityManagerInterface::class | ||
)); | ||
} | ||
|
||
return ORM\Tools\Console\ConsoleRunner::createHelperSet($entityManager); |
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); | ||
|
||
/** | ||
* Copyright (c) 2020 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/ergebnis/factory-bot | ||
*/ | ||
|
||
use Doctrine\ORM; | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$configuration = ORM\Tools\Setup::createAnnotationMetadataConfiguration( | ||
[ | ||
__DIR__ . '/../test/Fixture/Entity', | ||
], | ||
true | ||
); | ||
|
||
return ORM\EntityManager::create( | ||
[ | ||
'driver' => 'pdo_sqlite', | ||
'path' => ':memory:', | ||
], | ||
$configuration | ||
); |
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
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