-
-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow legacy configurations to improve interoperability with other do…
…ctrine cli tools
- Loading branch information
Showing
7 changed files
with
159 additions
and
0 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
13 changes: 13 additions & 0 deletions
13
tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-dbal/cli-config.php
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,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Doctrine\DBAL\DriverManager; | ||
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; | ||
use Symfony\Component\Console\Helper\HelperSet; | ||
|
||
$conn = DriverManager::getConnection(['driver' => 'pdo_sqlite', 'memory' => true]); | ||
|
||
return new HelperSet([ | ||
'db' => new ConnectionHelper($conn), | ||
]); |
5 changes: 5 additions & 0 deletions
5
tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-dbal/migrations.php
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,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return []; |
23 changes: 23 additions & 0 deletions
23
tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-orm/cli-config.php
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Doctrine\DBAL\DriverManager; | ||
use Doctrine\ORM\Configuration; | ||
use Doctrine\ORM\EntityManager; | ||
use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; | ||
use Doctrine\Persistence\Mapping\Driver\PHPDriver; | ||
use Symfony\Component\Console\Helper\HelperSet; | ||
|
||
$conf = new Configuration(); | ||
$conf->setProxyDir(__DIR__); | ||
$conf->setProxyNamespace('Foo'); | ||
$conf->setMetadataDriverImpl(new PHPDriver('')); | ||
|
||
$conn = DriverManager::getConnection(['driver' => 'pdo_sqlite', 'memory' => true]); | ||
|
||
$em = EntityManager::create($conn, $conf); | ||
|
||
return new HelperSet([ | ||
'em' => new EntityManagerHelper($em), | ||
]); |
5 changes: 5 additions & 0 deletions
5
tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-orm/migrations.php
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,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return []; |
13 changes: 13 additions & 0 deletions
13
tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-wrong/cli-config.php
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,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Doctrine\DBAL\DriverManager; | ||
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; | ||
use Symfony\Component\Console\Helper\HelperSet; | ||
|
||
$conn = DriverManager::getConnection(['driver' => 'pdo_sqlite', 'memory' => true]); | ||
|
||
return new HelperSet([ | ||
'abc' => new ConnectionHelper($conn), | ||
]); |