diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php index cc5979a..29dba4e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php @@ -36,6 +36,9 @@ public function testImageStyleUpgrade() { // Verify that image styles were properly upgraded. $expected_styles['test-custom'] = array( 'name' => 'test-custom', + 'label' => 'test-custom', + 'status' => '1', + 'langcode' => 'en', 'effects' => array( 'image_rotate' => array( 'id' => 'image_rotate', @@ -55,6 +58,9 @@ public function testImageStyleUpgrade() { ); $expected_styles['thumbnail'] = array( 'name' => 'thumbnail', + 'label' => 'thumbnail', + 'status' => '1', + 'langcode' => 'en', 'effects' => array ( 'image_scale' => array( 'id' => 'image_scale', @@ -67,11 +73,12 @@ public function testImageStyleUpgrade() { ), ), ); + $factory = $this->container->get('config.factory'); foreach ($expected_styles as $name => $style) { - $config = config('image.style.' . $name); + $configured_style = $factory->get('image.style.' . $name)->get(); // Replace placeholder with image effect name keys with UUID's generated // during by the image style upgrade functions. - foreach ($config->get('effects') as $uuid => $effect) { + foreach ($configured_style['effects'] as $uuid => $effect) { // Copy placeholder data. $style['effects'][$uuid] = $style['effects'][$effect['id']]; // Set the missing uuid key as this is unknown because it is a UUID. @@ -79,9 +86,13 @@ public function testImageStyleUpgrade() { // Remove the placeholder data. unset($style['effects'][$effect['id']]); } - $this->assertEqual($this->sortByKey($style), $config->get(), format_string('@first is equal to @second.', array( + // Make sure UUID assigned to new style. + $this->assertTrue($configured_style['uuid'], 'UUID assigned to converted style.'); + // Copy generated UUID to compared style. + $style['uuid'] = $configured_style['uuid']; + $this->assertEqual($this->sortByKey($style), $this->sortByKey($configured_style), format_string('@first is equal to @second.', array( '@first' => var_export($this->sortByKey($style), TRUE), - '@second' => var_export($config->get(), TRUE), + '@second' => var_export($this->sortByKey($configured_style), TRUE), ))); } } @@ -102,7 +113,7 @@ public function sortByKey(array $data) { ksort($data); foreach ($data as &$value) { if (is_array($value)) { - $this->sortByKey($value); + $value = $this->sortByKey($value); } } return $data;