Test Failed
Pull Request — master (#104)
by Alex
04:39
created
tests/MetadataManagerTest.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,6 @@
 block discarded – undo
8 8
 use AlgoWeb\ODataMetadata\MetadataV3\edm\Schema;
9 9
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TAssociationType;
10 10
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityTypeType;
11
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType;
12
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionType;
13 11
 use AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx;
14 12
 use Mockery as m;
15 13
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $ds = DIRECTORY_SEPARATOR;
34 34
 
35
-        $goodxsd = dirname(__DIR__) . $ds . "xsd" . $ds . "Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd";
35
+        $goodxsd = dirname(__DIR__).$ds."xsd".$ds."Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd";
36 36
         if (!file_exists($goodxsd)) {
37 37
             return true;
38 38
         }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $result = null;
48 48
 
49 49
         list($eType, $result) = $metadataManager->addEntityType("Category");
50
-        $this->assertNotFalse($eType, "Etype is false not type " . $metadataManager->getLastError());
50
+        $this->assertNotFalse($eType, "Etype is false not type ".$metadataManager->getLastError());
51 51
         $metadataManager->addPropertyToEntityType($eType, "CategoryID", "Int32", null, false, true, "Identity");
52 52
         $metadataManager->addPropertyToEntityType($eType, "CategoryName", "String");
53 53
         $metadataManager->addPropertyToEntityType($eType, "Description", "String");
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $result = null;
75 75
 
76 76
         list($CategoryType, $result) = $metadataManager->addEntityType("Category");
77
-        $this->assertNotFalse($CategoryType, "Etype is false not type " . $metadataManager->getLastError());
77
+        $this->assertNotFalse($CategoryType, "Etype is false not type ".$metadataManager->getLastError());
78 78
         $metadataManager->addPropertyToEntityType($CategoryType, "CategoryID", "Int32", null, false, true, "Identity");
79 79
         $metadataManager->addPropertyToEntityType($CategoryType, "CategoryName", "String");
80 80
         $metadataManager->addPropertyToEntityType($CategoryType, "Description", "String");
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
     {
503 503
         list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests();
504 504
 
505
-        $expected =  "Invalid multiplicity combination - 1 1";
505
+        $expected = "Invalid multiplicity combination - 1 1";
506 506
         $actual = null;
507 507
 
508 508
         try {
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
     {
525 525
         list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests();
526 526
 
527
-        $expected =  "Invalid multiplicity combination - * 0..1";
527
+        $expected = "Invalid multiplicity combination - * 0..1";
528 528
         $actual = null;
529 529
 
530 530
         try {
@@ -551,8 +551,8 @@  discard block
 block discarded – undo
551 551
         $metadataManager = new MetadataManager("Data", "Container");
552 552
         $result = null;
553 553
 
554
-        list($CategoryType, ) = $metadataManager->addEntityType("Category");
555
-        list($CustomerType, ) = $metadataManager->addEntityType("Customer");
554
+        list($CategoryType,) = $metadataManager->addEntityType("Category");
555
+        list($CustomerType,) = $metadataManager->addEntityType("Customer");
556 556
         $this->assertTrue($CategoryType->isOK($msg), $msg);
557 557
         $this->assertTrue($CustomerType->isOK($msg), $msg);
558 558
         return array($msg, $metadataManager, $CategoryType, $CustomerType);
Please login to merge, or discard this patch.
src/MetadataManager.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         if (0 == strlen(trim($namespace))) {
70 70
             $entityTypeName = $NewEntity->getName();
71 71
         } else {
72
-            $entityTypeName = $namespace . "." . $NewEntity->getName();
72
+            $entityTypeName = $namespace.".".$NewEntity->getName();
73 73
         }
74 74
         $entitySet->setEntityType($entityTypeName);
75 75
         $entitySet->setGetterAccess($accessType);
@@ -190,21 +190,21 @@  discard block
 block discarded – undo
190 190
     ) {
191 191
         $principalEntitySetName = Str::plural($principalType->getName(), 2);
192 192
         $dependentEntitySetName = Str::plural($dependentType->getName(), 2);
193
-        $relationName = $principalType->getName() . "_" . $principalProperty . "_"
194
-                        . $dependentType->getName() . "_" . $dependentProperty;
193
+        $relationName = $principalType->getName()."_".$principalProperty."_"
194
+                        . $dependentType->getName()."_".$dependentProperty;
195 195
         $relationName = trim($relationName, "_");
196 196
 
197 197
         $namespace = $this->V3Edmx->getDataServiceType()->getSchema()[0]->getNamespace();
198 198
         if (0 == strlen(trim($namespace))) {
199 199
             $relationFQName = $relationName;
200 200
         } else {
201
-            $relationFQName = $namespace . "." . $relationName;
201
+            $relationFQName = $namespace.".".$relationName;
202 202
         }
203 203
 
204 204
         $principalNavigationProperty = new TNavigationPropertyType();
205 205
         $principalNavigationProperty->setName($principalProperty);
206
-        $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_"));
207
-        $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty);
206
+        $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_"));
207
+        $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty);
208 208
         $principalNavigationProperty->setRelationship($relationFQName);
209 209
         $principalNavigationProperty->setGetterAccess($principalGetterAccess);
210 210
         $principalNavigationProperty->setSetterAccess($principalSetterAccess);
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
         if (!empty($dependentProperty)) {
220 220
             $dependentNavigationProperty = new TNavigationPropertyType();
221 221
             $dependentNavigationProperty->setName($dependentProperty);
222
-            $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty);
223
-            $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty);
222
+            $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty);
223
+            $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty);
224 224
             $dependentNavigationProperty->setRelationship($relationFQName);
225 225
             $dependentNavigationProperty->setGetterAccess($dependentGetterAccess);
226 226
             $dependentNavigationProperty->setSetterAccess($dependentSetterAccess);
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         array $principalConstraintProperty = null,
272 272
         array $dependentConstraintProperty = null
273 273
     ) {
274
-        $multCombo = [ '*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']];
274
+        $multCombo = ['*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']];
275 275
         $multKeys = array_keys($multCombo);
276 276
         if (null != $dependentNavigationProperty) {
277 277
             if ($dependentNavigationProperty->getRelationship() != $principalNavigationProperty->getRelationship()) {
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         }
291 291
         if (!in_array($dependentMultiplicity, $multCombo[$principalMultiplicity])) {
292 292
             throw new \InvalidArgumentException(
293
-                "Invalid multiplicity combination - ". $principalMultiplicity . ' ' . $dependentMultiplicity
293
+                "Invalid multiplicity combination - ".$principalMultiplicity.' '.$dependentMultiplicity
294 294
             );
295 295
         }
296 296
 
@@ -300,8 +300,8 @@  discard block
 block discarded – undo
300 300
             $principalTypeFQName = $principalType->getName();
301 301
             $dependentTypeFQName = $dependentType->getName();
302 302
         } else {
303
-            $principalTypeFQName = $namespace . "." . $principalType->getName();
304
-            $dependentTypeFQName = $namespace . "." . $dependentType->getName();
303
+            $principalTypeFQName = $namespace.".".$principalType->getName();
304
+            $dependentTypeFQName = $namespace.".".$dependentType->getName();
305 305
         }
306 306
         $association = new TAssociationType();
307 307
         $relationship = $principalNavigationProperty->getRelationship();
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         if (0 == strlen(trim($namespace))) {
370 370
             $associationSetName = $association->getName();
371 371
         } else {
372
-            $associationSetName = $namespace . "." . $association->getName();
372
+            $associationSetName = $namespace.".".$association->getName();
373 373
         }
374 374
         $as->setAssociation($associationSetName);
375 375
         $end1 = new EndAnonymousType();
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 
436 436
     private function initSerialiser()
437 437
     {
438
-        $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata";
438
+        $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata";
439 439
         $this->serializer =
440 440
             SerializerBuilder::create()
441 441
                 ->addMetadataDir($ymlDir)
Please login to merge, or discard this patch.