Completed
Pull Request — 2.6 (#8015)
by
unknown
06:46
created
tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheManyToManyTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
         $entity     = $this->_em->find(Travel::class, $entitiId);
233 233
 
234 234
         $this->assertEquals(0, $entity->getVisitedCities()->count());
235
-        $this->assertEquals($queryCount+2, $this->getCurrentQueryCount());
235
+        $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount());
236 236
 
237 237
         $this->_em->clear();
238 238
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,8 +102,8 @@
 block discarded – undo
102 102
         $routeId = $this->createPersistedRouteWithLegs();
103 103
 
104 104
         $route = $this->_em->createQuery("SELECT r, l FROM Doctrine\Tests\Models\Routing\RoutingRoute r JOIN r.legs l WHERE r.id = ?1")
105
-                           ->setParameter(1, $routeId)
106
-                           ->getSingleResult();
105
+                            ->setParameter(1, $routeId)
106
+                            ->getSingleResult();
107 107
 
108 108
         $this->assertEquals(2, count($route->legs));
109 109
         $this->assertEquals("Berlin", $route->legs[0]->fromLocation->getName());
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function testIssue2059()
29 29
     {
30
-        if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
30
+        if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
31 31
             $this->markTestSkipped('Platform does not support foreign keys.');
32 32
         }
33 33
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function testLoadMetadataFromDatabase()
51 51
     {
52
-        if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
52
+        if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
53 53
             $this->markTestSkipped('Platform does not support foreign keys.');
54 54
         }
55 55
 
@@ -65,22 +65,22 @@  discard block
 block discarded – undo
65 65
         $this->assertArrayHasKey('DbdriverFoo', $metadatas);
66 66
         $metadata = $metadatas['DbdriverFoo'];
67 67
 
68
-        $this->assertArrayHasKey('id',          $metadata->fieldMappings);
69
-        $this->assertEquals('id',               $metadata->fieldMappings['id']['fieldName']);
70
-        $this->assertEquals('id',               strtolower($metadata->fieldMappings['id']['columnName']));
71
-        $this->assertEquals('integer',          (string)$metadata->fieldMappings['id']['type']);
68
+        $this->assertArrayHasKey('id', $metadata->fieldMappings);
69
+        $this->assertEquals('id', $metadata->fieldMappings['id']['fieldName']);
70
+        $this->assertEquals('id', strtolower($metadata->fieldMappings['id']['columnName']));
71
+        $this->assertEquals('integer', (string) $metadata->fieldMappings['id']['type']);
72 72
 
73
-        $this->assertArrayHasKey('bar',         $metadata->fieldMappings);
74
-        $this->assertEquals('bar',              $metadata->fieldMappings['bar']['fieldName']);
75
-        $this->assertEquals('bar',              strtolower($metadata->fieldMappings['bar']['columnName']));
76
-        $this->assertEquals('string',           (string)$metadata->fieldMappings['bar']['type']);
77
-        $this->assertEquals(200,                $metadata->fieldMappings['bar']['length']);
73
+        $this->assertArrayHasKey('bar', $metadata->fieldMappings);
74
+        $this->assertEquals('bar', $metadata->fieldMappings['bar']['fieldName']);
75
+        $this->assertEquals('bar', strtolower($metadata->fieldMappings['bar']['columnName']));
76
+        $this->assertEquals('string', (string) $metadata->fieldMappings['bar']['type']);
77
+        $this->assertEquals(200, $metadata->fieldMappings['bar']['length']);
78 78
         $this->assertTrue($metadata->fieldMappings['bar']['nullable']);
79 79
     }
80 80
 
81 81
     public function testLoadMetadataWithForeignKeyFromDatabase()
82 82
     {
83
-        if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
83
+        if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
84 84
             $this->markTestSkipped('Platform does not support foreign keys.');
85 85
         }
86 86
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
     public function testDetectManyToManyTables()
116 116
     {
117
-        if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
117
+        if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
118 118
             $this->markTestSkipped('Platform does not support foreign keys.');
119 119
         }
120 120
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
         $table->addColumn('column_index1', 'string');
171 171
         $table->addColumn('column_index2', 'string');
172
-        $table->addIndex(['column_index1','column_index2'], 'index1');
172
+        $table->addIndex(['column_index1', 'column_index2'], 'index1');
173 173
 
174 174
         $table->addColumn('column_unique_index1', 'string');
175 175
         $table->addColumn('column_unique_index2', 'string');
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
         $this->assertTrue( ! empty($metadata->table['indexes']['index1']['columns']));
210 210
         $this->assertEquals(
211
-            ['column_index1','column_index2'],
211
+            ['column_index1', 'column_index2'],
212 212
             $metadata->table['indexes']['index1']['columns']
213 213
         );
214 214
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/EntityManagerTest.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
     public function testCreateQueryBuilderAliasValid()
104 104
     {
105 105
         $q = $this->_em->createQueryBuilder()
106
-             ->select('u')->from(CmsUser::class, 'u');
106
+                ->select('u')->from(CmsUser::class, 'u');
107 107
         $q2 = clone $q;
108 108
 
109 109
         $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q->getQuery()->getDql());
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function testThrowsExceptionOnNonObjectValues($methodName) {
164 164
         $this->expectException(ORMInvalidArgumentException::class);
165
-        $this->expectExceptionMessage('EntityManager#' . $methodName . '() expects parameter 1 to be an entity object, NULL given.');
165
+        $this->expectExceptionMessage('EntityManager#'.$methodName.'() expects parameter 1 to be an entity object, NULL given.');
166 166
 
167 167
         $this->_em->$methodName(null);
168 168
     }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public function testTransactionalAcceptsReturn()
198 198
     {
199
-        $return = $this->_em->transactional(function ($em) {
199
+        $return = $this->_em->transactional(function($em) {
200 200
             return 'foo';
201 201
         });
202 202
 
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
     public function testTransactionalReThrowsThrowables()
239 239
     {
240 240
         try {
241
-            $this->_em->transactional(function () {
242
-                (function (array $value) {
241
+            $this->_em->transactional(function() {
242
+                (function(array $value) {
243 243
                     // this only serves as an IIFE that throws a `TypeError`
244 244
                 })(null);
245 245
             });
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $methods = [];
36 36
 
37 37
         foreach ($class->getMethods() as $method) {
38
-            if ($method->isConstructor() || $method->isStatic() || !$method->isPublic()) {
38
+            if ($method->isConstructor() || $method->isStatic() || ! $method->isPublic()) {
39 39
                 continue;
40 40
             }
41 41
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, array $parameters)
74 74
     {
75
-        $return = !in_array($method, self::VOID_METHODS) ? 'INNER VALUE FROM ' . $method : null;
75
+        $return = ! in_array($method, self::VOID_METHODS) ? 'INNER VALUE FROM '.$method : null;
76 76
 
77 77
         $this->wrapped->expects($this->once())
78 78
             ->method($method)
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 $metadata,
90 90
                 Events::postLoad,
91 91
                 $entity,
92
-                $this->callback(function (LifecycleEventArgs $args) use ($entityManager, $entity) {
92
+                $this->callback(function(LifecycleEventArgs $args) use ($entityManager, $entity) {
93 93
                     return $entity === $args->getEntity() && $entityManager === $args->getObjectManager();
94 94
                 }),
95 95
                 $listenersFlag
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                 $this->logicalOr($metadata1, $metadata2),
158 158
                 Events::postLoad,
159 159
                 $this->logicalOr($entity1, $entity2),
160
-                $this->callback(function (LifecycleEventArgs $args) use ($entityManager, $entity1, $entity2) {
160
+                $this->callback(function(LifecycleEventArgs $args) use ($entityManager, $entity1, $entity2) {
161 161
                     return in_array($args->getEntity(), [$entity1, $entity2], true)
162 162
                         && $entityManager === $args->getObjectManager();
163 163
                 }),
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
         $rsm->addMetaResult('p ', 'discr', 'discr', false, 'string');
28 28
         $rsm->setDiscriminatorColumn('p', 'discr');
29 29
         $resultSet = [
30
-              [
31
-                  'u__id'   => '1',
32
-                  'u__name' => 'Fabio B. Silva'
33
-              ],
30
+                [
31
+                    'u__id'   => '1',
32
+                    'u__name' => 'Fabio B. Silva'
33
+                ],
34 34
         ];
35 35
 
36 36
         $stmt       = new HydratorMockStatement($resultSet);
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
         $rsm->setDiscriminatorColumn('p', 'discr');
81 81
 
82 82
         $resultSet = [
83
-              [
84
-                  'p__id'   => '1',
85
-                  'p__name' => 'Fabio B. Silva',
86
-                  'discr'   => 'subworker'
87
-              ],
83
+                [
84
+                    'p__id'   => '1',
85
+                    'p__name' => 'Fabio B. Silva',
86
+                    'discr'   => 'subworker'
87
+                ],
88 88
         ];
89 89
 
90 90
         $stmt       = new HydratorMockStatement($resultSet);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -189,8 +189,8 @@
 block discarded – undo
189 189
     }
190 190
 
191 191
         /**
192
-     * @group DDC-1663
193
-     */
192
+         * @group DDC-1663
193
+         */
194 194
     public function testAddNamedNativeQueryResultSetMappingWithoutFields()
195 195
     {
196 196
         $cm = new ClassMetadata(CmsUser::class);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
     {
77 77
         $rms = $this->_rsm;
78 78
 
79
-        $this->_rsm->addEntityResult(CmsUser::class,'u');
80
-        $this->_rsm->addJoinedEntityResult(CmsPhonenumber::class,'p','u','phonenumbers');
79
+        $this->_rsm->addEntityResult(CmsUser::class, 'u');
80
+        $this->_rsm->addJoinedEntityResult(CmsPhonenumber::class, 'p', 'u', 'phonenumbers');
81 81
         $this->_rsm->addFieldResult('u', 'id', 'id');
82 82
         $this->_rsm->addFieldResult('u', 'name', 'name');
83 83
         $this->_rsm->setDiscriminatorColumn('name', 'name');
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
     {
277 277
         $this->_rsm->addEntityResult(LegacyUser::class, 'u');
278 278
         $this->_rsm->addJoinedEntityResult(LegacyUserReference::class, 'lu', 'u', '_references');
279
-        $this->_rsm->addMetaResult('lu', '_source',  '_source', true, 'integer');
280
-        $this->_rsm->addMetaResult('lu', '_target',  '_target', true, 'integer');
279
+        $this->_rsm->addMetaResult('lu', '_source', '_source', true, 'integer');
280
+        $this->_rsm->addMetaResult('lu', '_target', '_target', true, 'integer');
281 281
         $this->_rsm->addIndexBy('lu', '_source');
282 282
 
283 283
         $this->assertTrue($this->_rsm->hasIndexBy('lu'));
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1020,14 +1020,14 @@  discard block
 block discarded – undo
1020 1020
 
1021 1021
         // mocking the proxy factory
1022 1022
         $proxyFactory = $this->getMockBuilder(ProxyFactory::class)
1023
-                             ->setMethods(['getProxy'])
1024
-                             ->disableOriginalConstructor()
1025
-                             ->getMock();
1023
+                                ->setMethods(['getProxy'])
1024
+                                ->disableOriginalConstructor()
1025
+                                ->getMock();
1026 1026
 
1027 1027
         $proxyFactory->expects($this->once())
1028
-                     ->method('getProxy')
1029
-                     ->with($this->equalTo(ECommerceShipping::class), ['id' => 42])
1030
-                     ->will($this->returnValue($proxyInstance));
1028
+                        ->method('getProxy')
1029
+                        ->with($this->equalTo(ECommerceShipping::class), ['id' => 42])
1030
+                        ->will($this->returnValue($proxyInstance));
1031 1031
 
1032 1032
         $this->_em->setProxyFactory($proxyFactory);
1033 1033
 
@@ -1069,14 +1069,14 @@  discard block
 block discarded – undo
1069 1069
 
1070 1070
         // mocking the proxy factory
1071 1071
         $proxyFactory = $this->getMockBuilder(ProxyFactory::class)
1072
-                             ->setMethods(['getProxy'])
1073
-                             ->disableOriginalConstructor()
1074
-                             ->getMock();
1072
+                                ->setMethods(['getProxy'])
1073
+                                ->disableOriginalConstructor()
1074
+                                ->getMock();
1075 1075
 
1076 1076
         $proxyFactory->expects($this->once())
1077
-                     ->method('getProxy')
1078
-                     ->with($this->equalTo(ECommerceShipping::class), ['id' => 42])
1079
-                     ->will($this->returnValue($proxyInstance));
1077
+                        ->method('getProxy')
1078
+                        ->with($this->equalTo(ECommerceShipping::class), ['id' => 42])
1079
+                        ->will($this->returnValue($proxyInstance));
1080 1080
 
1081 1081
         $this->_em->setProxyFactory($proxyFactory);
1082 1082
 
@@ -1836,10 +1836,10 @@  discard block
 block discarded – undo
1836 1836
         $rsm->setDiscriminatorColumn('c', 'c_discr');
1837 1837
 
1838 1838
         $resultSet = [
1839
-              [
1840
-                  'c__id'   => '1',
1841
-                  'c_discr' => 'fix',
1842
-              ],
1839
+                [
1840
+                    'c__id'   => '1',
1841
+                    'c_discr' => 'fix',
1842
+                ],
1843 1843
         ];
1844 1844
 
1845 1845
         $stmt     = new HydratorMockStatement($resultSet);
@@ -1868,12 +1868,12 @@  discard block
 block discarded – undo
1868 1868
         $rsm->setDiscriminatorColumn('e', 'e_discr');
1869 1869
 
1870 1870
         $resultSet = [
1871
-              [
1872
-                  'c__id'   => '1',
1873
-                  'c_discr' => 'fix',
1874
-                  'e__id'   => '1',
1875
-                  'e__name' => 'Fabio B. Silva'
1876
-              ],
1871
+                [
1872
+                    'c__id'   => '1',
1873
+                    'c_discr' => 'fix',
1874
+                    'e__id'   => '1',
1875
+                    'e__name' => 'Fabio B. Silva'
1876
+                ],
1877 1877
         ];
1878 1878
 
1879 1879
         $stmt     = new HydratorMockStatement($resultSet);
@@ -1898,11 +1898,11 @@  discard block
 block discarded – undo
1898 1898
         $rsm->setDiscriminatorColumn('p', 'discr');
1899 1899
 
1900 1900
         $resultSet = [
1901
-              [
1902
-                  'p__id'   => '1',
1903
-                  'p__name' => 'Fabio B. Silva',
1904
-                  'discr'   => 'subworker'
1905
-              ],
1901
+                [
1902
+                    'p__id'   => '1',
1903
+                    'p__name' => 'Fabio B. Silva',
1904
+                    'discr'   => 'subworker'
1905
+                ],
1906 1906
         ];
1907 1907
 
1908 1908
         $stmt       = new HydratorMockStatement($resultSet);
Please login to merge, or discard this patch.