@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | parent::setUp(); |
25 | 25 | $this->_factory = new ProxyFactory( |
26 | 26 | $this->_em, |
27 | - __DIR__ . '/../../Proxies', |
|
27 | + __DIR__.'/../../Proxies', |
|
28 | 28 | 'Doctrine\Tests\Proxies', |
29 | 29 | true); |
30 | 30 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $id = $this->createProduct(); |
70 | 70 | |
71 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
71 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
72 | 72 | $class = $this->_em->getClassMetadata(get_class($entity)); |
73 | 73 | |
74 | 74 | $this->assertEquals(ECommerceProduct::class, $class->name); |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | { |
82 | 82 | $id = $this->createProduct(); |
83 | 83 | |
84 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
85 | - $entity2 = $this->_em->find(ECommerceProduct::class , $id); |
|
84 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
85 | + $entity2 = $this->_em->find(ECommerceProduct::class, $id); |
|
86 | 86 | |
87 | 87 | $this->assertSame($entity, $entity2); |
88 | 88 | $this->assertEquals('Doctrine Cookbook', $entity2->getName()); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $id = $this->createProduct(); |
97 | 97 | |
98 | 98 | /* @var $entity ECommerceProduct */ |
99 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
99 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
100 | 100 | |
101 | 101 | /* @var $clone ECommerceProduct */ |
102 | 102 | $clone = clone $entity; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $id = $this->createProduct(); |
122 | 122 | |
123 | 123 | /* @var $entity ECommerceProduct */ |
124 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
124 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
125 | 125 | |
126 | 126 | $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); |
127 | 127 | $this->_em->getUnitOfWork()->initializeObject($entity); |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | $id = $this->createProduct(); |
137 | 137 | |
138 | 138 | /* @var $entity ECommerceProduct */ |
139 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
139 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
140 | 140 | $entity->setName('Doctrine 2 Cookbook'); |
141 | 141 | |
142 | 142 | $this->_em->flush(); |
143 | 143 | $this->_em->clear(); |
144 | 144 | |
145 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
145 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
146 | 146 | $this->assertEquals('Doctrine 2 Cookbook', $entity->getName()); |
147 | 147 | } |
148 | 148 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $id = $this->createProduct(); |
155 | 155 | |
156 | 156 | /* @var $entity ECommerceProduct */ |
157 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
157 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
158 | 158 | |
159 | 159 | $this->assertFalse($entity->wakeUp); |
160 | 160 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $id = $this->createProduct(); |
169 | 169 | |
170 | 170 | /* @var $entity ECommerceProduct */ |
171 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
171 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
172 | 172 | |
173 | 173 | $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); |
174 | 174 | $this->assertEquals($id, $entity->getId()); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $id = $this->createAuction(); |
184 | 184 | |
185 | 185 | /* @var $entity CompanyAuction */ |
186 | - $entity = $this->_em->getReference(CompanyAuction::class , $id); |
|
186 | + $entity = $this->_em->getReference(CompanyAuction::class, $id); |
|
187 | 187 | |
188 | 188 | $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); |
189 | 189 | $this->assertEquals($id, $entity->getId()); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $id = $this->createProduct(); |
219 | 219 | |
220 | 220 | /* @var $entity ECommerceProduct */ |
221 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
221 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
222 | 222 | |
223 | 223 | $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); |
224 | 224 | $this->assertEquals('Doctrine Cookbook', $entity->getName()); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $id = $this->createProduct(); |
234 | 234 | |
235 | 235 | /* @var $entity ECommerceProduct */ |
236 | - $entity = $this->_em->getReference(ECommerceProduct::class , $id); |
|
236 | + $entity = $this->_em->getReference(ECommerceProduct::class, $id); |
|
237 | 237 | $className = ClassUtils::getClass($entity); |
238 | 238 | |
239 | 239 | $this->assertInstanceOf(Proxy::class, $entity); |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | $this->assertEquals(ECommerceProduct::class, $className); |
242 | 242 | |
243 | 243 | $restName = str_replace($this->_em->getConfiguration()->getProxyNamespace(), "", get_class($entity)); |
244 | - $restName = substr(get_class($entity), strlen($this->_em->getConfiguration()->getProxyNamespace()) +1); |
|
245 | - $proxyFileName = $this->_em->getConfiguration()->getProxyDir() . DIRECTORY_SEPARATOR . str_replace("\\", "", $restName) . ".php"; |
|
244 | + $restName = substr(get_class($entity), strlen($this->_em->getConfiguration()->getProxyNamespace()) + 1); |
|
245 | + $proxyFileName = $this->_em->getConfiguration()->getProxyDir().DIRECTORY_SEPARATOR.str_replace("\\", "", $restName).".php"; |
|
246 | 246 | $this->assertFileExists($proxyFileName, "Proxy file name cannot be found generically."); |
247 | 247 | |
248 | 248 | $entity->__load(); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | $driverMock = new DriverMock(); |
32 | 32 | $config = new Configuration(); |
33 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
33 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
34 | 34 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
35 | 35 | $eventManager = new EventManager(); |
36 | 36 | $conn = new ConnectionMock([], $driverMock, $config, $eventManager); |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $cme = new ClassMetadataExporter(); |
49 | - $converter = new ConvertDoctrine1Schema(__DIR__ . '/doctrine1schema'); |
|
49 | + $converter = new ConvertDoctrine1Schema(__DIR__.'/doctrine1schema'); |
|
50 | 50 | |
51 | - $exporter = $cme->getExporter('yml', __DIR__ . '/convert'); |
|
51 | + $exporter = $cme->getExporter('yml', __DIR__.'/convert'); |
|
52 | 52 | $exporter->setOverwriteExistingFiles(true); |
53 | 53 | $exporter->setMetadata($converter->getMetadata()); |
54 | 54 | $exporter->export(); |
55 | 55 | |
56 | - $this->assertFileExists(__DIR__ . '/convert/User.dcm.yml'); |
|
57 | - $this->assertFileExists(__DIR__ . '/convert/Profile.dcm.yml'); |
|
56 | + $this->assertFileExists(__DIR__.'/convert/User.dcm.yml'); |
|
57 | + $this->assertFileExists(__DIR__.'/convert/Profile.dcm.yml'); |
|
58 | 58 | |
59 | - $metadataDriver = new YamlDriver(__DIR__ . '/convert'); |
|
59 | + $metadataDriver = new YamlDriver(__DIR__.'/convert'); |
|
60 | 60 | $em = $this->_createEntityManager($metadataDriver); |
61 | 61 | $cmf = new DisconnectedClassMetadataFactory(); |
62 | 62 | $cmf->setEntityManager($em); |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | |
82 | 82 | public function tearDown() |
83 | 83 | { |
84 | - @unlink(__DIR__ . '/convert/User.dcm.yml'); |
|
85 | - @unlink(__DIR__ . '/convert/Profile.dcm.yml'); |
|
86 | - @rmdir(__DIR__ . '/convert'); |
|
84 | + @unlink(__DIR__.'/convert/User.dcm.yml'); |
|
85 | + @unlink(__DIR__.'/convert/Profile.dcm.yml'); |
|
86 | + @rmdir(__DIR__.'/convert'); |
|
87 | 87 | } |
88 | 88 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $driverMock = new DriverMock(); |
43 | 43 | $config = new Configuration(); |
44 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
44 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
45 | 45 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
46 | 46 | $eventManager = new EventManager(); |
47 | 47 | $conn = new ConnectionMock([], $driverMock, $config, $eventManager); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'yaml' => YamlDriver::class, |
60 | 60 | ]; |
61 | 61 | |
62 | - $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'."); |
|
62 | + $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'."); |
|
63 | 63 | |
64 | 64 | $class = $mappingDriver[$type]; |
65 | 65 | $driver = ($type === 'annotation') |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | |
83 | 83 | public function testExportDirectoryAndFilesAreCreated() |
84 | 84 | { |
85 | - $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType()); |
|
85 | + $this->_deleteDirectory(__DIR__.'/export/'.$this->_getType()); |
|
86 | 86 | |
87 | 87 | $type = $this->_getType(); |
88 | - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/' . $type); |
|
88 | + $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/'.$type); |
|
89 | 89 | $em = $this->_createEntityManager($metadataDriver); |
90 | 90 | $cmf = $this->_createClassMetadataFactory($em, $type); |
91 | 91 | $metadata = $cmf->getAllMetadata(); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | $type = $this->_getType(); |
98 | 98 | $cme = new ClassMetadataExporter(); |
99 | - $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type); |
|
99 | + $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type); |
|
100 | 100 | |
101 | 101 | if ($type === 'annotation') { |
102 | 102 | $entityGenerator = new EntityGenerator(); |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | $exporter->export(); |
112 | 112 | |
113 | 113 | if ($type == 'annotation') { |
114 | - $this->assertFileExists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->_extension); |
|
114 | + $this->assertFileExists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->_extension); |
|
115 | 115 | } else { |
116 | - $this->assertFileExists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension); |
|
116 | + $this->assertFileExists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $type = $this->_getType(); |
126 | 126 | |
127 | - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/export/' . $type); |
|
127 | + $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/export/'.$type); |
|
128 | 128 | $em = $this->_createEntityManager($metadataDriver); |
129 | 129 | $cmf = $this->_createClassMetadataFactory($em, $type); |
130 | 130 | $metadata = $cmf->getAllMetadata(); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $type = $this->_getType(); |
211 | 211 | |
212 | 212 | if ($type == 'xml') { |
213 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
213 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
214 | 214 | |
215 | 215 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
216 | 216 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:field[@name='name' and @type='string' and @nullable='true']"); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $type = $this->_getType(); |
355 | 355 | |
356 | 356 | if ($type == 'xml') { |
357 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
357 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
358 | 358 | |
359 | 359 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
360 | 360 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*"); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $this->assertEquals('cascade-all', $nodes[0]->getName()); |
364 | 364 | } else if ($type == 'yaml') { |
365 | 365 | $yaml = new Parser(); |
366 | - $value = $yaml->parse(file_get_contents(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); |
|
366 | + $value = $yaml->parse(file_get_contents(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); |
|
367 | 367 | |
368 | 368 | $this->assertTrue(isset($value[ExportedUser::class]['oneToMany']['interests']['cascade'])); |
369 | 369 | $this->assertEquals(1, count($value[ExportedUser::class]['oneToMany']['interests']['cascade'])); |
@@ -403,10 +403,10 @@ discard block |
||
403 | 403 | if (is_file($path)) { |
404 | 404 | return unlink($path); |
405 | 405 | } else if (is_dir($path)) { |
406 | - $files = glob(rtrim($path,'/').'/*'); |
|
406 | + $files = glob(rtrim($path, '/').'/*'); |
|
407 | 407 | |
408 | 408 | if (is_array($files)) { |
409 | - foreach ($files as $file){ |
|
409 | + foreach ($files as $file) { |
|
410 | 410 | $this->_deleteDirectory($file); |
411 | 411 | } |
412 | 412 | } |