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 3ecbd6b
Showing
7 changed files
with
75 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,21 @@ | ||
<?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; | ||
use Ergebnis\FactoryBot\Test\Util; | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$entityManager = Util\ORM\EntityManagerFactory::create(); | ||
|
||
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
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,37 @@ | ||
<?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 | ||
*/ | ||
|
||
namespace Ergebnis\FactoryBot\Test\Util\Doctrine\ORM; | ||
|
||
use Doctrine\ORM; | ||
|
||
final class EntityManagerFactory | ||
{ | ||
public static function create(): ORM\EntityManagerInterface | ||
{ | ||
$configuration = ORM\Tools\Setup::createAnnotationMetadataConfiguration( | ||
[ | ||
__DIR__ . '/../../../test/Fixture/Entity', | ||
], | ||
true | ||
); | ||
|
||
return ORM\EntityManager::create( | ||
[ | ||
'driver' => 'pdo_sqlite', | ||
'path' => ':memory:', | ||
], | ||
$configuration | ||
); | ||
} | ||
} |