diff --git a/core/modules/config/src/Controller/ConfigController.php b/core/modules/config/src/Controller/ConfigController.php index fa77776..8906178 100644 --- a/core/modules/config/src/Controller/ConfigController.php +++ b/core/modules/config/src/Controller/ConfigController.php @@ -55,7 +55,7 @@ class ConfigController implements ContainerInjectionInterface { * * @var \Drupal\Core\Diff\DiffFormatter */ - protected $diffFormater; + protected $diffFormatter; /** * {@inheritdoc} */ @@ -84,7 +84,7 @@ public function __construct(StorageInterface $target_storage, StorageInterface $ $this->sourceStorage = $source_storage; $this->configManager = $config_manager; $this->fileDownloadController = $file_download_controller; - $this->diffFormater = $diff_formatter; + $this->diffFormatter = $diff_formatter; } /** @@ -111,7 +111,7 @@ public function downloadExport() { } /** - * Shows diff of specificed configuration file. + * Shows diff of specified configuration file. * * @param string $source_name * The name of the configuration file. @@ -144,7 +144,7 @@ public function diff($source_name, $target_name = NULL, $collection = NULL) { array('data' => t('Old'), 'colspan' => '2'), array('data' => t('New'), 'colspan' => '2'), ), - '#rows' => $this->diffFormater->format($diff), + '#rows' => $this->diffFormatter->format($diff), ); $build['back'] = array( diff --git a/core/modules/config/src/Tests/ConfigDiffTest.php b/core/modules/config/src/Tests/ConfigDiffTest.php index 6fad374..03902e4 100644 --- a/core/modules/config/src/Tests/ConfigDiffTest.php +++ b/core/modules/config/src/Tests/ConfigDiffTest.php @@ -139,15 +139,17 @@ function testCollectionDiff() { // Test the fields match in the default collection diff. $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name); - $this->assertEqual($diff->edits[0]->type, 'copy', 'The first item in the diff is a copy.'); - $this->assertEqual(count($diff->edits), 1, 'There is one item in the diff'); + $edits = $diff->getEdits(); + $this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.'); + $this->assertEqual(count($edits), 1, 'There is one item in the diff'); // Test that the differences are detected when diffing the collection. $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name, NULL, 'test'); - $this->assertEqual($diff->edits[0]->type, 'change', 'The second item in the diff is a copy.'); - $this->assertEqual($diff->edits[0]->orig, array('foo: bar')); - $this->assertEqual($diff->edits[0]->closing, array('foo: baz')); - $this->assertEqual($diff->edits[1]->type, 'copy', 'The second item in the diff is a copy.'); + $edits = $diff->getEdits(); + $this->assertEqual($edits[0]->type, 'change', 'The second item in the diff is a copy.'); + $this->assertEqual($edits[0]->orig, array('foo: bar')); + $this->assertEqual($edits[0]->closing, array('foo: baz')); + $this->assertEqual($edits[1]->type, 'copy', 'The second item in the diff is a copy.'); } }