Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Config / Entity / ConfigEntityBaseUnitTest.php
index 0d417ab494040439366c67e99ef2e5ce53257673..ebb41d63fbc81ac8b5847d54bf79c1bee221306e 100644 (file)
@@ -283,13 +283,13 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
           'config_dependencies' => [
             'config' => [$instance_dependency_1],
             'module' => [$instance_dependency_2],
-          ]
+          ],
         ],
         [
           'config' => [$instance_dependency_1],
-          'module' => [$instance_dependency_2, 'test']
-        ]
-      ]
+          'module' => [$instance_dependency_2, 'test'],
+        ],
+      ],
     ];
   }
 
@@ -552,32 +552,6 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
     $this->assertEquals(['configId' => $entity->id(), 'dependencies' => []], $properties);
   }
 
-  /**
-   * @covers ::toArray
-   */
-  public function testToArraySchemaFallback() {
-    $this->typedConfigManager->expects($this->once())
-      ->method('getDefinition')
-      ->will($this->returnValue(['mapping' => ['id' => '', 'dependencies' => '']]));
-    $this->entityType->expects($this->any())
-      ->method('getPropertiesToExport')
-      ->willReturn([]);
-    $properties = $this->entity->toArray();
-    $this->assertInternalType('array', $properties);
-    $this->assertEquals(['id' => $this->entity->id(), 'dependencies' => []], $properties);
-  }
-
-  /**
-   * @covers ::toArray
-   */
-  public function testToArrayFallback() {
-    $this->entityType->expects($this->any())
-      ->method('getPropertiesToExport')
-      ->willReturn([]);
-    $this->setExpectedException(SchemaIncompleteException::class);
-    $this->entity->toArray();
-  }
-
   /**
    * @covers ::getThirdPartySetting
    * @covers ::setThirdPartySetting
@@ -612,6 +586,17 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
     $this->assertEquals([$third_party], $this->entity->getThirdPartyProviders());
   }
 
+  /**
+   * @covers ::toArray
+   */
+  public function testToArraySchemaException() {
+    $this->entityType->expects($this->any())
+      ->method('getPropertiesToExport')
+      ->willReturn(NULL);
+    $this->setExpectedException(SchemaIncompleteException::class, 'Incomplete or missing schema for test_provider.');
+    $this->entity->toArray();
+  }
+
 }
 
 class TestConfigEntityWithPluginCollections extends ConfigEntityBaseWithPluginCollections {