diff --git a/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php b/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php index b09d95e..b58c6a8 100644 --- a/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php +++ b/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php @@ -20,16 +20,16 @@ class ConfigEntityTest extends JavascriptTestBase { /** * Tests CRUD operations through the UI. */ - function testCRUDUI() { + public function testCRUDUI() { $this->drupalLogin($this->drupalCreateUser(['administer site configuration'])); $id = strtolower($this->randomMachineName()); $label1 = $this->randomMachineName(); $label2 = $this->randomMachineName(); $label3 = $this->randomMachineName(); - $message_insert = new FormattableMarkup('%label configuration has been created.', array('%label' => $label1)); - $message_update = new FormattableMarkup('%label configuration has been updated.', array('%label' => $label2)); - $message_delete = new FormattableMarkup('The test configuration %label has been deleted.', array('%label' => $label2)); + $message_insert = new FormattableMarkup('%label configuration has been created.', ['%label' => $label1]); + $message_update = new FormattableMarkup('%label configuration has been updated.', ['%label' => $label2]); + $message_delete = new FormattableMarkup('The test configuration %label has been deleted.', ['%label' => $label2]); // Create a configuration entity. $this->drupalGet('admin/structure/config_test/add'); @@ -51,7 +51,7 @@ function testCRUDUI() { $assert_session->statusCodeEquals(200); $assert_session->responseContains($message_insert); $assert_session->responseNotContains($message_update); - $this->assertNotEmpty($page->find('css' , 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); + $this->assertNotNull($page->find('css', 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); // Update the configuration entity. $this->drupalGet("admin/structure/config_test/manage/$id"); @@ -61,8 +61,8 @@ function testCRUDUI() { $assert_session->statusCodeEquals(200); $assert_session->responseNotContains($message_insert); $assert_session->responseContains($message_update); - $this->assertNotEmpty($page->find('css' , 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); - $this->assertNotEmpty($page->find('css' , 'a[href="/admin/structure/config_test/manage/' . $id . '/delete"]')); + $this->assertNotNull($page->find('css', 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); + $this->assertNotNull($page->find('css', 'a[href="/admin/structure/config_test/manage/' . $id . '/delete"]')); // Delete the configuration entity. $this->drupalGet("admin/structure/config_test/manage/$id"); @@ -75,7 +75,7 @@ function testCRUDUI() { $assert_session->responseNotContains($message_update); $assert_session->responseContains($message_delete); $assert_session->responseNotContains($label1); - $this->assertEmpty($page->find('css' , 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); + $this->assertNull($page->find('css', 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); // Re-create a configuration entity. $this->drupalGet('admin/structure/config_test/add'); @@ -86,7 +86,7 @@ function testCRUDUI() { $assert_session->addressEquals('admin/structure/config_test'); $assert_session->statusCodeEquals(200); $assert_session->responseContains($label1); - $this->assertNotEmpty($page->find('css' , 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); + $this->assertNotNull($page->find('css', 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); // Rename the configuration entity's ID/machine name. $new_id = strtolower($this->randomMachineName()); @@ -100,10 +100,10 @@ function testCRUDUI() { $assert_session->responseNotContains($label1); $assert_session->responseNotContains($label2); $assert_session->responseContains($label3); - $this->assertEmpty($page->find('css' , 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); + $this->assertNull($page->find('css', 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); $id = $new_id; - $this->assertNotEmpty($page->find('css' , 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); + $this->assertNotNull($page->find('css', 'a[href="/admin/structure/config_test/manage/' . $id . '"]')); // Create a configuration entity with '0' machine name. $this->drupalGet('admin/structure/config_test/add'); @@ -112,11 +112,11 @@ function testCRUDUI() { $button_save->click(); $assert_session->statusCodeEquals(200); - $message_insert = new FormattableMarkup('%label configuration has been created.', array('%label' => '0')); + $message_insert = new FormattableMarkup('%label configuration has been created.', ['%label' => '0']); $assert_session->responseContains($message_insert); - $this->assertNotEmpty($page->find('css' , 'a[href="/admin/structure/config_test/manage/0"]')); - $delete_link = $page->find('css' , 'a[href="/admin/structure/config_test/manage/0/delete"]'); + $this->assertNotNull($page->find('css', 'a[href="/admin/structure/config_test/manage/0"]')); + $delete_link = $page->find('css', 'a[href="/admin/structure/config_test/manage/0/delete"]'); // Expand the options. $ul = $delete_link->getParent()->getParent(); @@ -137,8 +137,8 @@ function testCRUDUI() { // Test that the dependent element is not shown initially. $field_size = $page->findField('size'); $field_size_value = $page->findField('size_value'); - $this->assertNotEmpty($field_size); - $this->assertEmpty($field_size_value); + $this->assertNotNull($field_size); + $this->assertNull($field_size_value); $id = strtolower($this->randomMachineName()); $field_id->setValue($id); @@ -148,8 +148,8 @@ function testCRUDUI() { // Check that the dependent element is shown after selecting a 'size' value. $field_size_value = $page->findField('size_value'); - $this->assertNotEmpty($field_size); - $this->assertNotEmpty($field_size_value); + $this->assertNotNull($field_size); + $this->assertNotNull($field_size_value); $field_size_value->setValue('medium'); $button_save->click();