@@ -2,28 +2,28 @@ |
||
2 | 2 | /* |
3 | 3 | * This file bootstraps the test environment. |
4 | 4 | */ |
5 | -declare(strict_types=1); |
|
5 | +declare(strict_types = 1); |
|
6 | 6 | |
7 | 7 | namespace Doctrine\Tests; |
8 | 8 | |
9 | 9 | error_reporting(E_ALL | E_STRICT); |
10 | 10 | date_default_timezone_set('UTC'); |
11 | 11 | |
12 | -if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { |
|
12 | +if (file_exists(__DIR__.'/../../../vendor/autoload.php')) { |
|
13 | 13 | // dependencies were installed via composer - this is the main project |
14 | - require __DIR__ . '/../../../vendor/autoload.php'; |
|
15 | -} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) { |
|
14 | + require __DIR__.'/../../../vendor/autoload.php'; |
|
15 | +} elseif (file_exists(__DIR__.'/../../../../../autoload.php')) { |
|
16 | 16 | // installed as a dependency in `vendor` |
17 | - require __DIR__ . '/../../../../../autoload.php'; |
|
17 | + require __DIR__.'/../../../../../autoload.php'; |
|
18 | 18 | } else { |
19 | 19 | throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?'); |
20 | 20 | } |
21 | 21 | |
22 | -if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) { |
|
23 | - throw new \Exception("Could not create " . __DIR__."/Proxies Folder."); |
|
22 | +if ( ! file_exists(__DIR__.'/Proxies') && ! mkdir(__DIR__.'/Proxies')) { |
|
23 | + throw new \Exception("Could not create ".__DIR__."/Proxies Folder."); |
|
24 | 24 | } |
25 | 25 | |
26 | -if ( ! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) { |
|
27 | - throw new \Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.'); |
|
26 | +if ( ! file_exists(__DIR__.'/ORM/Proxy/generated') && ! mkdir(__DIR__.'/ORM/Proxy/generated')) { |
|
27 | + throw new \Exception('Could not create '.__DIR__.'/ORM/Proxy/generated Folder.'); |
|
28 | 28 | } |
29 | 29 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests; |
6 | 6 |
@@ -786,7 +786,11 @@ |
||
786 | 786 | foreach ($last25queries as $i => $query) { |
787 | 787 | $params = array_map( |
788 | 788 | function($p) { |
789 | - if (is_object($p)) return get_class($p); else return var_export($p, true); |
|
789 | + if (is_object($p)) { |
|
790 | + return get_class($p); |
|
791 | + } else { |
|
792 | + return var_export($p, true); |
|
793 | + } |
|
790 | 794 | }, |
791 | 795 | $query['params'] ?: [] |
792 | 796 | ); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests; |
6 | 6 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $conn->executeUpdate('DELETE FROM RoutingLocation'); |
404 | 404 | } |
405 | 405 | |
406 | - if(isset($this->usedModelSets['navigation'])) { |
|
406 | + if (isset($this->usedModelSets['navigation'])) { |
|
407 | 407 | $conn->executeUpdate('DELETE FROM navigation_tour_pois'); |
408 | 408 | $conn->executeUpdate('DELETE FROM navigation_photos'); |
409 | 409 | $conn->executeUpdate('DELETE FROM navigation_pois'); |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | } |
413 | 413 | |
414 | 414 | if (isset($this->usedModelSets['directorytree'])) { |
415 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("file")); |
|
415 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("file")); |
|
416 | 416 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
417 | 417 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
418 | 418 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -505,12 +505,12 @@ discard block |
||
505 | 505 | ) |
506 | 506 | ); |
507 | 507 | |
508 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
509 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-group")); |
|
510 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-phone")); |
|
511 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-user")); |
|
512 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-address")); |
|
513 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
508 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
509 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-group")); |
|
510 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-phone")); |
|
511 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-user")); |
|
512 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-address")); |
|
513 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -645,15 +645,15 @@ discard block |
||
645 | 645 | { |
646 | 646 | $this->setUpDBALTypes(); |
647 | 647 | |
648 | - if (! isset(static::$sharedConn)) { |
|
648 | + if ( ! isset(static::$sharedConn)) { |
|
649 | 649 | static::$sharedConn = TestUtil::getConnection(); |
650 | 650 | } |
651 | 651 | |
652 | 652 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
653 | 653 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ["mysql", "postgresql"])) { |
654 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/'); |
|
654 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/'); |
|
655 | 655 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === "oracle") { |
656 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); |
|
656 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/ FROM dual'); |
|
657 | 657 | } |
658 | 658 | } |
659 | 659 | |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | } |
664 | 664 | |
665 | 665 | foreach ($this->usedModelSets as $setName => $bool) { |
666 | - if (! isset(static::$tablesCreated[$setName])) { |
|
666 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
667 | 667 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
668 | 668 | |
669 | 669 | static::$tablesCreated[$setName] = true; |
@@ -738,8 +738,8 @@ discard block |
||
738 | 738 | |
739 | 739 | $config->setMetadataDriverImpl( |
740 | 740 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
741 | - realpath(__DIR__ . '/Models/Cache'), |
|
742 | - realpath(__DIR__ . '/Models/GeoNames') |
|
741 | + realpath(__DIR__.'/Models/Cache'), |
|
742 | + realpath(__DIR__.'/Models/GeoNames') |
|
743 | 743 | ]) |
744 | 744 | ); |
745 | 745 | |
@@ -803,9 +803,9 @@ discard block |
||
803 | 803 | $trace = $e->getTrace(); |
804 | 804 | $traceMsg = ""; |
805 | 805 | |
806 | - foreach($trace AS $part) { |
|
807 | - if(isset($part['file'])) { |
|
808 | - if(strpos($part['file'], "PHPUnit/") !== false) { |
|
806 | + foreach ($trace AS $part) { |
|
807 | + if (isset($part['file'])) { |
|
808 | + if (strpos($part['file'], "PHPUnit/") !== false) { |
|
809 | 809 | // Beginning with PHPUnit files we don't print the trace anymore. |
810 | 810 | break; |
811 | 811 | } |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | |
817 | 817 | $message = "[".get_class($e)."] ".$e->getMessage().PHP_EOL.PHP_EOL."With queries:".PHP_EOL.$queries.PHP_EOL."Trace:".PHP_EOL.$traceMsg; |
818 | 818 | |
819 | - throw new \Exception($message, (int)$e->getCode(), $e); |
|
819 | + throw new \Exception($message, (int) $e->getCode(), $e); |
|
820 | 820 | } |
821 | 821 | |
822 | 822 | throw $e; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Utility; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
6 | 6 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | protected function loadDriver() |
22 | 22 | { |
23 | - return new XmlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'xml'); |
|
23 | + return new XmlDriver(__DIR__.DIRECTORY_SEPARATOR.'xml'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function testClassTableInheritanceDiscriminatorMap() |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function testValidateXmlSchema($xmlMappingFile) |
164 | 164 | { |
165 | - $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; |
|
165 | + $xsdSchemaFile = __DIR__.'/../../../../../doctrine-mapping.xsd'; |
|
166 | 166 | $dom = new \DOMDocument('UTF-8'); |
167 | 167 | |
168 | 168 | $dom->load($xmlMappingFile); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | static public function dataValidSchema() |
174 | 174 | { |
175 | - $list = glob(__DIR__ . '/xml/*.xml'); |
|
175 | + $list = glob(__DIR__.'/xml/*.xml'); |
|
176 | 176 | $invalid = [ |
177 | 177 | 'Doctrine.Tests.Models.DDC889.DDC889Class.dcm' |
178 | 178 | ]; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return ! in_array(pathinfo($item, PATHINFO_FILENAME), $invalid); |
182 | 182 | }); |
183 | 183 | |
184 | - return array_map(function($item){ |
|
184 | + return array_map(function($item) { |
|
185 | 185 | return [$item]; |
186 | 186 | }, $list); |
187 | 187 | } |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use Doctrine\ORM\Mapping\ClassMetadata; |
8 | 8 | use Doctrine\ORM\Mapping\ClassMetadataFactory; |
9 | 9 | use Doctrine\ORM\Mapping\Driver\XmlDriver; |
10 | -use Doctrine\ORM\Reflection\RuntimeReflectionService; |
|
11 | 10 | use Doctrine\Tests\Models\DDC117\DDC117Translation; |
12 | 11 | use Doctrine\Tests\Models\DDC3293\DDC3293User; |
13 | 12 | use Doctrine\Tests\Models\DDC3293\DDC3293UserPrefixed; |
@@ -1241,7 +1241,7 @@ |
||
1241 | 1241 | $association->setCascade(['invalid']); |
1242 | 1242 | |
1243 | 1243 | $cm->addProperty($association); |
1244 | - } |
|
1244 | + } |
|
1245 | 1245 | |
1246 | 1246 | /** |
1247 | 1247 | * @group DDC-964 |
@@ -29,7 +29,6 @@ |
||
29 | 29 | use Doctrine\Tests\Models\Routing\RoutingLeg; |
30 | 30 | use Doctrine\Tests\OrmTestCase; |
31 | 31 | use DoctrineGlobal_Article; |
32 | -use SebastianBergmann\Environment\Runtime; |
|
33 | 32 | |
34 | 33 | require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
35 | 34 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | use DoctrineGlobal_Article; |
32 | 32 | use SebastianBergmann\Environment\Runtime; |
33 | 33 | |
34 | -require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
34 | +require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
35 | 35 | |
36 | 36 | class ClassMetadataTest extends OrmTestCase |
37 | 37 | { |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | public function testEmptyFieldNameThrowsException() |
805 | 805 | { |
806 | 806 | $this->expectException(MappingException::class); |
807 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
807 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
808 | 808 | |
809 | 809 | $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
810 | 810 | $cm->setTable(new Mapping\TableMetadata('cms_users')); |
@@ -947,12 +947,12 @@ discard block |
||
947 | 947 | $mapping = $cm->getSqlResultSetMapping('find-all'); |
948 | 948 | |
949 | 949 | self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
950 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
951 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
950 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
951 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
952 | 952 | |
953 | 953 | self::assertEquals(CMS\CmsEmail::class, $mapping['entities'][1]['entityClass']); |
954 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
955 | - self::assertEquals(['name'=>'email','column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
954 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
955 | + self::assertEquals(['name'=>'email', 'column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
956 | 956 | |
957 | 957 | self::assertEquals('scalarColumn', $mapping['columns'][0]['name']); |
958 | 958 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | $cm->addLifecycleCallback('notfound', 'postLoad'); |
1150 | 1150 | |
1151 | 1151 | $this->expectException(MappingException::class); |
1152 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback."); |
|
1152 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback."); |
|
1153 | 1153 | |
1154 | 1154 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
1155 | 1155 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | $cm->addProperty($association); |
1170 | 1170 | |
1171 | 1171 | $this->expectException(MappingException::class); |
1172 | - $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
1172 | + $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '".CMS\CmsUser::class."#address'."); |
|
1173 | 1173 | |
1174 | 1174 | $cm->validateAssociations(); |
1175 | 1175 | } |
@@ -1510,6 +1510,6 @@ discard block |
||
1510 | 1510 | */ |
1511 | 1511 | public function propertyToColumnName($propertyName, $className = null) |
1512 | 1512 | { |
1513 | - return strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
1513 | + return strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
1514 | 1514 | } |
1515 | 1515 | } |
@@ -129,13 +129,13 @@ discard block |
||
129 | 129 | $cmf = new ClassMetadataFactory(); |
130 | 130 | $driver = $this->createMock(MappingDriver::class); |
131 | 131 | $driver->expects($this->at(0)) |
132 | - ->method('isTransient') |
|
133 | - ->with($this->equalTo(CmsUser::class)) |
|
134 | - ->will($this->returnValue(true)); |
|
132 | + ->method('isTransient') |
|
133 | + ->with($this->equalTo(CmsUser::class)) |
|
134 | + ->will($this->returnValue(true)); |
|
135 | 135 | $driver->expects($this->at(1)) |
136 | - ->method('isTransient') |
|
137 | - ->with($this->equalTo(CmsArticle::class)) |
|
138 | - ->will($this->returnValue(false)); |
|
136 | + ->method('isTransient') |
|
137 | + ->with($this->equalTo(CmsArticle::class)) |
|
138 | + ->will($this->returnValue(false)); |
|
139 | 139 | |
140 | 140 | $em = $this->createEntityManager($driver); |
141 | 141 | |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | $cmf = new ClassMetadataFactory(); |
152 | 152 | $driver = $this->createMock(MappingDriver::class); |
153 | 153 | $driver->expects($this->at(0)) |
154 | - ->method('isTransient') |
|
155 | - ->with($this->equalTo(CmsUser::class)) |
|
156 | - ->will($this->returnValue(true)); |
|
154 | + ->method('isTransient') |
|
155 | + ->with($this->equalTo(CmsUser::class)) |
|
156 | + ->will($this->returnValue(true)); |
|
157 | 157 | $driver->expects($this->at(1)) |
158 | - ->method('isTransient') |
|
159 | - ->with($this->equalTo(CmsArticle::class)) |
|
160 | - ->will($this->returnValue(false)); |
|
158 | + ->method('isTransient') |
|
159 | + ->with($this->equalTo(CmsArticle::class)) |
|
160 | + ->will($this->returnValue(false)); |
|
161 | 161 | |
162 | 162 | $em = $this->createEntityManager($driver); |
163 | 163 | $em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); |
@@ -316,8 +316,8 @@ discard block |
||
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
319 | - * @group DDC-1845 |
|
320 | - */ |
|
319 | + * @group DDC-1845 |
|
320 | + */ |
|
321 | 321 | public function testQuoteMetadata() |
322 | 322 | { |
323 | 323 | $cmf = new ClassMetadataFactory(); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
6 | 6 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; |
115 | 115 | |
116 | - $metadataDriver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Global/']); |
|
116 | + $metadataDriver = $this->createAnnotationDriver([__DIR__.'/../../Models/Global/']); |
|
117 | 117 | |
118 | 118 | $entityManager = $this->createEntityManager($metadataDriver); |
119 | 119 | |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | |
122 | 122 | self::assertSame( |
123 | 123 | $mf->getMetadataFor(DoctrineGlobal_Article::class), |
124 | - $mf->getMetadataFor('\\' . DoctrineGlobal_Article::class) |
|
124 | + $mf->getMetadataFor('\\'.DoctrineGlobal_Article::class) |
|
125 | 125 | ); |
126 | 126 | self::assertTrue($mf->hasMetadataFor(DoctrineGlobal_Article::class)); |
127 | - self::assertTrue($mf->hasMetadataFor('\\' . DoctrineGlobal_Article::class)); |
|
127 | + self::assertTrue($mf->hasMetadataFor('\\'.DoctrineGlobal_Article::class)); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | public function testAddDefaultDiscriminatorMap() |
176 | 176 | { |
177 | 177 | $cmf = new ClassMetadataFactory(); |
178 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/JoinedInheritanceType/']); |
|
178 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/JoinedInheritanceType/']); |
|
179 | 179 | $em = $this->createEntityManager($driver); |
180 | 180 | $cmf->setEntityManager($em); |
181 | 181 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | { |
216 | 216 | // DDC-3551 |
217 | 217 | $conn = $this->createMock(Connection::class); |
218 | - $mockDriver = new MetadataDriverMock(); |
|
218 | + $mockDriver = new MetadataDriverMock(); |
|
219 | 219 | $conn->expects($this->any()) |
220 | 220 | ->method('getEventManager') |
221 | 221 | ->willReturn(new EventManager()); |
@@ -239,10 +239,10 @@ discard block |
||
239 | 239 | $driverMock = new DriverMock(); |
240 | 240 | $config = new Configuration(); |
241 | 241 | |
242 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
242 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
243 | 243 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
244 | 244 | |
245 | - if (!$conn) { |
|
245 | + if ( ! $conn) { |
|
246 | 246 | $conn = new ConnectionMock([], $driverMock, $config, new EventManager()); |
247 | 247 | } |
248 | 248 | $eventManager = $conn->getEventManager(); |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | public function testQuoteMetadata() |
334 | 334 | { |
335 | 335 | $cmf = new ClassMetadataFactory(); |
336 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Quote/']); |
|
336 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/Quote/']); |
|
337 | 337 | $em = $this->createEntityManager($driver); |
338 | 338 | $cmf->setEntityManager($em); |
339 | 339 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $listener |
423 | 423 | ->expects($this->any()) |
424 | 424 | ->method('onClassMetadataNotFound') |
425 | - ->will($this->returnCallback(function (OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
425 | + ->will($this->returnCallback(function(OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
426 | 426 | $test->assertNull($args->getFoundMetadata()); |
427 | 427 | $test->assertSame('Foo', $args->getClassName()); |
428 | 428 | $test->assertSame($em, $args->getObjectManager()); |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | public function testInheritsIdGeneratorMappingFromEmbeddable() |
485 | 485 | { |
486 | 486 | $cmf = new ClassMetadataFactory(); |
487 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/DDC4006/']); |
|
487 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/DDC4006/']); |
|
488 | 488 | $em = $this->createEntityManager($driver); |
489 | 489 | $cmf->setEntityManager($em); |
490 | 490 |
@@ -234,6 +234,9 @@ discard block |
||
234 | 234 | self::assertEquals([], $metadata); |
235 | 235 | } |
236 | 236 | |
237 | + /** |
|
238 | + * @param \PHPUnit\Framework\MockObject\MockObject $conn |
|
239 | + */ |
|
237 | 240 | protected function createEntityManager($metadataDriver, $conn = null) |
238 | 241 | { |
239 | 242 | $driverMock = new DriverMock(); |
@@ -265,7 +268,6 @@ discard block |
||
265 | 268 | } |
266 | 269 | |
267 | 270 | /** |
268 | - * @param string $class |
|
269 | 271 | * @return ClassMetadata |
270 | 272 | */ |
271 | 273 | protected function createValidClassMetadata() |
@@ -515,6 +517,10 @@ discard block |
||
515 | 517 | return $this->mockMetadata[$className]; |
516 | 518 | } |
517 | 519 | |
520 | + /** |
|
521 | + * @param string $className |
|
522 | + * @param ClassMetadata $metadata |
|
523 | + */ |
|
518 | 524 | public function setMetadataForClass($className, $metadata) |
519 | 525 | { |
520 | 526 | $this->mockMetadata[$className] = $metadata; |