diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index f19c03d..7630928 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -70,22 +70,22 @@ function testList() { $this->assertIdentical($expected_operations, $actual_operations, 'Return value from getOperations matches expected.'); // Test buildHeader() method. + $entity_info = entity_get_info('config_test'); $expected_items = array( - 'label' => 'Label', - 'id' => 'Machine name', + 'title' => $entity_info['label'], 'operations' => 'Operations', ); $actual_items = $controller->buildHeader(); $this->assertIdentical($expected_items, $actual_items, 'Return value from buildHeader matches expected.'); // Test buildRow() method. - $build_operations = $controller->buildOperations($entity); $expected_items = array( - 'label' => 'Default', - 'id' => 'default', 'operations' => array( - 'data' => $build_operations, + 'data' => $controller->buildOperations($entity), ), + 'title' => array('data' => array( + '#markup' => l('Default', $uri['path'], $uri['options']), + )), ); $actual_items = $controller->buildRow($entity); $this->assertIdentical($expected_items, $actual_items, 'Return value from buildRow matches expected.'); @@ -110,24 +110,26 @@ function testListUI() { // Test the table header. $elements = $this->xpath('//div[@id="content"]//table/thead/tr/th'); - $this->assertEqual(count($elements), 3, 'Correct number of table header cells found.'); + $this->assertEqual(count($elements), 2, 'Correct number of table header cells found.'); // Test the contents of each th cell. - $expected_items = array('Label', 'Machine name', 'Operations'); + $entity_info = entity_get_info('config_test'); + $expected_items = array($entity_info['label'], 'Operations'); foreach ($elements as $key => $element) { $this->assertIdentical((string) $element[0], $expected_items[$key]); } // Check the number of table row cells. $elements = $this->xpath('//div[@id="content"]//table/tbody/tr[@class="odd"]/td'); - $this->assertEqual(count($elements), 3, 'Correct number of table row cells found.'); + $this->assertEqual(count($elements), 2, 'Correct number of table row cells found.'); // Check the contents of each row cell. The first cell contains the label, // the second contains the machine name, and the third contains the // operations list. - $this->assertIdentical((string) $elements[0], 'Default'); - $this->assertIdentical((string) $elements[1], 'default'); - $this->assertTrue($elements[2]->children()->xpath('//ul'), 'Operations list found.'); + $title = $elements[0]->children(); + $this->assertIdentical((string) $title[0]['href'], '/admin/structure/config_test/manage/default'); + $this->assertIdentical((string) $title, 'Default'); + $this->assertTrue($elements[1]->children()->xpath('//ul'), 'Operations list found.'); // Add a new entity using the operations link. $this->assertLink('Add test configuration'); @@ -139,8 +141,8 @@ function testListUI() { // Confirm that the user is returned to the listing, and verify that the // text of the label and machine name appears in the list (versus elsewhere // on the page). - $this->assertFieldByXpath('//td', 'Antelope', "Label found for added 'Antelope' entity."); - $this->assertFieldByXpath('//td', 'antelope', "Machine name found for added 'Antelope' entity."); + $this->assertText('Antelope'); + $this->assertLinkByHref('/admin/structure/config_test/manage/antelope'); // Edit the entity using the operations link. $this->assertLink('Edit'); @@ -153,8 +155,9 @@ function testListUI() { // Confirm that the user is returned to the listing, and verify that the // text of the label and machine name appears in the list (versus elsewhere // on the page). - $this->assertFieldByXpath('//td', 'Albatross', "Label found for updated 'Albatross' entity."); - $this->assertFieldByXpath('//td', 'albatross', "Machine name found for updated 'Albatross' entity."); + $element = $this->xpath('//td/a'); + $this->assertFieldByXpath('//td/a', 'Albatross', "Label found for updated 'Albatross' entity."); + $this->assertEqual($element[0]['href'], '/admin/structure/config_test/manage/albatross', "Machine name found for updated 'Albatross' entity."); // Delete the added entity using the operations link. $this->assertLink('Delete'); diff --git a/core/modules/picture/lib/Drupal/picture/Tests/PictureAdminUITest.php b/core/modules/picture/lib/Drupal/picture/Tests/PictureAdminUITest.php index 114e30c..cca5880 100644 --- a/core/modules/picture/lib/Drupal/picture/Tests/PictureAdminUITest.php +++ b/core/modules/picture/lib/Drupal/picture/Tests/PictureAdminUITest.php @@ -99,7 +99,6 @@ public function testPictureAdmin() { $this->drupalGet('admin/config/media/picturemapping'); $this->assertNoText('There is no Picture mapping yet.'); $this->assertText('Mapping One'); - $this->assertText('mapping_one'); // Edit the group. $this->drupalGet('admin/config/media/picturemapping/mapping_one/edit');