only in patch2: unchanged: --- a/core/modules/action/tests/src/Functional/ActionUninstallTest.php +++ b/core/modules/action/tests/src/Functional/ActionUninstallTest.php @@ -27,7 +27,7 @@ public function testActionUninstall() { $storage = $this->container->get('entity_type.manager')->getStorage('action'); $storage->resetCache(['user_block_user_action']); - $this->assertTrue($storage->load('user_block_user_action'), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.' ); + $this->assertNotEmpty($storage->load('user_block_user_action'), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.' ); $admin_user = $this->drupalCreateUser(array('administer users')); $this->drupalLogin($admin_user); only in patch2: unchanged: --- a/core/modules/action/tests/src/Functional/BulkFormTest.php +++ b/core/modules/action/tests/src/Functional/BulkFormTest.php @@ -47,7 +47,7 @@ public function testBulkForm() { // Test that the views edit header appears first. $first_form_element = $this->xpath('//form/div[1][@id = :id]', array(':id' => 'edit-header')); - $this->assertTrue($first_form_element, 'The views form edit header appears first.'); + $this->assertNotEmpty($first_form_element, 'The views form edit header appears first.'); $this->assertFieldById('edit-action', NULL, 'The action select field appears.'); @@ -146,7 +146,7 @@ public function testBulkForm() { // Make sure we don't show an action message while we are still on the // confirmation page. $errors = $this->xpath('//div[contains(@class, "messages--status")]'); - $this->assertFalse($errors, 'No action message shown.'); + $this->assertEmpty($errors, 'No action message shown.'); $this->drupalPostForm(NULL, array(), t('Delete')); $this->assertText(t('Deleted 5 posts.')); // Check if we got redirected to the original page. only in patch2: unchanged: --- a/core/modules/action/tests/src/Functional/ConfigurationTest.php +++ b/core/modules/action/tests/src/Functional/ConfigurationTest.php @@ -83,7 +83,7 @@ function testActionConfiguration() { $this->assertNoText($new_action_label, "Make sure the action label does not appear on the overview page after we've deleted the action."); $action = Action::load($aid); - $this->assertFalse($action, 'Make sure the action is gone after being deleted.'); + $this->assertEmpty($action, 'Make sure the action is gone after being deleted.'); } } only in patch2: unchanged: --- a/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php +++ b/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php @@ -34,7 +34,7 @@ function testIPAddressValidation() { $edit['ip'] = '1.2.3.3'; $this->drupalPostForm('admin/config/people/ban', $edit, t('Add')); $ip = db_query("SELECT iid from {ban_ip} WHERE ip = :ip", array(':ip' => $edit['ip']))->fetchField(); - $this->assertTrue($ip, 'IP address found in database.'); + $this->assertNotEmpty($ip, 'IP address found in database.'); $this->assertRaw(t('The IP address %ip has been banned.', array('%ip' => $edit['ip'])), 'IP address was banned.'); // Try to block an IP address that's already blocked. @@ -65,7 +65,7 @@ function testIPAddressValidation() { $submit_ip = '1.2.3.4'; $this->drupalPostForm('admin/config/people/ban/' . $submit_ip, array(), t('Add')); $ip = db_query("SELECT iid from {ban_ip} WHERE ip = :ip", array(':ip' => $submit_ip))->fetchField(); - $this->assertTrue($ip, 'IP address found in database'); + $this->assertNotEmpty($ip, 'IP address found in database'); $this->assertRaw(t('The IP address %ip has been banned.', array('%ip' => $submit_ip)), 'IP address was banned.'); // Submit your own IP address. This fails, although it works when testing only in patch2: unchanged: --- a/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php @@ -70,7 +70,7 @@ public function testForwardRevisions() { /** @var Node $page */ $page = Node::load($id); $this->assertEquals('A', $page->getTitle()); - $this->assertTrue($page->isDefaultRevision()); + $this->assertNotEmpty($page->isDefaultRevision()); $this->assertFalse($page->isPublished()); // Moderate the entity to published. @@ -81,7 +81,7 @@ public function testForwardRevisions() { // Verify the entity is now published and public. $page = Node::load($id); $this->assertEquals('B', $page->getTitle()); - $this->assertTrue($page->isDefaultRevision()); + $this->assertNotEmpty($page->isDefaultRevision()); $this->assertTrue($page->isPublished()); // Make a new forward-revision in Draft. @@ -111,7 +111,7 @@ public function testForwardRevisions() { // Verify normal loads return the still-default previous version. $page = Node::load($id); $this->assertEquals('D', $page->getTitle()); - $this->assertTrue($page->isDefaultRevision()); + $this->assertNotEmpty($page->isDefaultRevision()); $this->assertTrue($page->isPublished()); // Now check that we can immediately add a new published revision over it. @@ -121,7 +121,7 @@ public function testForwardRevisions() { $page = Node::load($id); $this->assertEquals('E', $page->getTitle()); - $this->assertTrue($page->isDefaultRevision()); + $this->assertNotEmpty($page->isDefaultRevision()); $this->assertTrue($page->isPublished()); } @@ -143,7 +143,7 @@ public function testPublishedCreation() { /** @var Node $page */ $page = Node::load($id); $this->assertEquals('A', $page->getTitle()); - $this->assertTrue($page->isDefaultRevision()); + $this->assertNotEmpty($page->isDefaultRevision()); $this->assertTrue($page->isPublished()); } @@ -191,7 +191,7 @@ public function testArchive() { $storage = \Drupal::entityTypeManager()->getStorage('node'); $new_revision = $storage->loadRevision($new_revision_id); $this->assertFalse($new_revision->isPublished()); - $this->assertTrue($new_revision->isDefaultRevision()); + $this->assertNotEmpty($new_revision->isDefaultRevision()); } } only in patch2: unchanged: --- a/core/modules/content_moderation/tests/src/Kernel/EntityRevisionConverterTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/EntityRevisionConverterTest.php @@ -89,7 +89,7 @@ public function testConvertWithRevisionableEntityType() { $this->assertInstanceOf(Node::class, $result['node']); $this->assertEquals($revision_ids[2], $result['node']->getRevisionId()); - $this->assertFalse($result['node']->isDefaultRevision()); + $this->assertEmpty($result['node']->isDefaultRevision()); } } only in patch2: unchanged: --- a/core/modules/editor/src/Tests/EditorDialogAccessTest.php +++ b/core/modules/editor/src/Tests/EditorDialogAccessTest.php @@ -65,8 +65,8 @@ public function testEditorImageDialogAccess() { $editor->save(); $this->resetAll(); $this->drupalGet($url); - $this->assertTrue($this->cssSelect('input[type=text][name="attributes[src]"]'), 'Image uploads disabled: input[type=text][name="attributes[src]"] is present.'); - $this->assertFalse($this->cssSelect('input[type=file]'), 'Image uploads disabled: input[type=file] is absent.'); + $this->assertNotEmpty($this->cssSelect('input[type=text][name="attributes[src]"]'), 'Image uploads disabled: input[type=text][name="attributes[src]"] is present.'); + $this->assertEmpty($this->cssSelect('input[type=file]'), 'Image uploads disabled: input[type=file] is absent.'); $session->statusCodeEquals(200); // With image upload settings, expect a 200, and now there should be an @@ -75,8 +75,8 @@ public function testEditorImageDialogAccess() { ->save(); $this->resetAll(); $this->drupalGet($url); - $this->assertFalse($this->cssSelect('input[type=text][name="attributes[src]"]'), 'Image uploads enabled: input[type=text][name="attributes[src]"] is absent.'); - $this->assertTrue($this->cssSelect('input[type=file]'), 'Image uploads enabled: input[type=file] is present.'); + $this->assertEmpty($this->cssSelect('input[type=text][name="attributes[src]"]'), 'Image uploads enabled: input[type=text][name="attributes[src]"] is absent.'); + $this->assertNotEmpty($this->cssSelect('input[type=file]'), 'Image uploads enabled: input[type=file] is present.'); $session->statusCodeEquals(200); } only in patch2: unchanged: --- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php @@ -62,7 +62,7 @@ protected function setUp() { */ protected function assertTranslations($id, $default, $others = []) { $entity = $this->storage->load($id); - $this->assertTrue($entity, "Entity exists"); + $this->assertNotEmpty($entity, "Entity exists"); $this->assertEquals($default, $entity->language()->getId(), "Entity default translation"); $translations = array_keys($entity->getTranslationLanguages(FALSE)); sort($others); @@ -107,7 +107,7 @@ public function testTranslated() { $this->assertTranslations(1, 'en'); $this->assertTranslations(2, 'fr'); $this->assertTranslations(3, 'en', ['fr']); - $this->assertFalse($this->storage->load(4)); + $this->assertEmpty($this->storage->load(4)); $destination_rows = [ // Existing default translation. only in patch2: unchanged: --- a/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php +++ b/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php @@ -56,7 +56,7 @@ public function testEntityViewDisplayDependency() { // Check that the 'foo' field is on the display. $this->assertNotNull($display = EntityViewDisplay::load('entity_test.entity_test.default')); - $this->assertTrue($display->getComponent('bar')); + $this->assertNotEmpty($display->getComponent('bar')); $this->assertArrayNotHasKey('bar', $display->get('hidden')); // Delete the responsive image style. only in patch2: unchanged: --- a/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php +++ b/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php @@ -51,7 +51,7 @@ public function testBuildResponse() { // No custom header should be set yet. $response = RestExport::buildResponse('test_serializer_display_entity', 'rest_export_1', []); - $this->assertFalse($response->headers->get('Custom-Header')); + $this->assertEmpty($response->headers->get('Custom-Header')); // Clear render cache. /** @var \Drupal\Core\Cache\MemoryBackend $render_cache */ only in patch2: unchanged: --- a/core/modules/system/tests/src/Kernel/System/CronQueueTest.php +++ b/core/modules/system/tests/src/Kernel/System/CronQueueTest.php @@ -106,7 +106,7 @@ public function testExceptions() { $this->cron->run(); $this->assertEqual(\Drupal::state()->get('cron_queue_test_requeue_exception'), 2); - $this->assertFalse($queue->numberOfItems()); + $this->assertEmpty($queue->numberOfItems()); } } only in patch2: unchanged: --- a/core/modules/user/src/Tests/UserMailNotifyTest.php +++ b/core/modules/user/src/Tests/UserMailNotifyTest.php @@ -69,7 +69,7 @@ public function testUserMailsSent($op, array $mail_keys) { public function testUserMailsNotSent($op, array $mail_keys) { $this->config('user.settings')->set('notify.' . $op, FALSE)->save(); $return = _user_mail_notify($op, $this->createUser()); - $this->assertFalse($return, '_user_mail_notify() returns FALSE.'); + $this->assertEmpty($return, '_user_mail_notify() returns NULL.'); $this->assertEmpty($this->getMails(), 'No emails sent by _user_mail_notify().'); } only in patch2: unchanged: --- a/core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php @@ -63,36 +63,36 @@ protected function setUp($import_test_views = TRUE) { public function testMenuLinkOverrides() { // Link from views module. $views_link = $this->menuLinkManager->getDefinition('views_view:views.test_page_display_menu.page_3'); - $this->assertTrue($views_link['enabled'], 'Menu link is enabled.'); - $this->assertFalse($views_link['expanded'], 'Menu link is not expanded.'); + $this->assertNotEmpty($views_link['enabled'], 'Menu link is enabled.'); + $this->assertEmpty($views_link['expanded'], 'Menu link is not expanded.'); $views_link['enabled'] = 0; $views_link['expanded'] = 1; $this->menuLinkManager->updateDefinition($views_link['id'], $views_link); $views_link = $this->menuLinkManager->getDefinition($views_link['id']); - $this->assertFalse($views_link['enabled'], 'Menu link is disabled.'); - $this->assertTrue($views_link['expanded'], 'Menu link is expanded.'); + $this->assertEmpty($views_link['enabled'], 'Menu link is disabled.'); + $this->assertNotEmpty($views_link['expanded'], 'Menu link is expanded.'); $this->menuLinkManager->rebuild(); - $this->assertFalse($views_link['enabled'], 'Menu link is disabled.'); - $this->assertTrue($views_link['expanded'], 'Menu link is expanded.'); + $this->assertEmpty($views_link['enabled'], 'Menu link is disabled.'); + $this->assertNotEmpty($views_link['expanded'], 'Menu link is expanded.'); // Link from user module. $user_link = $this->menuLinkManager->getDefinition('user.page'); - $this->assertTrue($user_link['enabled'], 'Menu link is enabled.'); + $this->assertNotEmpty($user_link['enabled'], 'Menu link is enabled.'); $user_link['enabled'] = 0; $views_link['expanded'] = 1; $this->menuLinkManager->updateDefinition($user_link['id'], $user_link); - $this->assertFalse($user_link['enabled'], 'Menu link is disabled.'); + $this->assertEmpty($user_link['enabled'], 'Menu link is disabled.'); $this->menuLinkManager->rebuild(); - $this->assertFalse($user_link['enabled'], 'Menu link is disabled.'); + $this->assertEmpty($user_link['enabled'], 'Menu link is disabled.'); $this->menuLinkOverrides->reload(); $views_link = $this->menuLinkManager->getDefinition('views_view:views.test_page_display_menu.page_3'); - $this->assertFalse($views_link['enabled'], 'Menu link is disabled.'); - $this->assertTrue($views_link['expanded'], 'Menu link is expanded.'); + $this->assertEmpty($views_link['enabled'], 'Menu link is disabled.'); + $this->assertNotEmpty($views_link['expanded'], 'Menu link is expanded.'); $user_link = $this->menuLinkManager->getDefinition('user.page'); - $this->assertFalse($user_link['enabled'], 'Menu link is disabled.'); + $this->assertEmpty($user_link['enabled'], 'Menu link is disabled.'); } } only in patch2: unchanged: --- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php @@ -37,10 +37,10 @@ function testRaceCondition() { $lock_backend = \Drupal::lock(); $registry = new ThemeRegistry($cid, $cache, $lock_backend, array('theme_registry'), $this->container->get('module_handler')->isLoaded()); - $this->assertTrue(\Drupal::cache()->get($cid), 'Cache entry was created.'); + $this->assertNotEmpty(\Drupal::cache()->get($cid), 'Cache entry was created.'); // Trigger a cache miss for an offset. - $this->assertTrue($registry->get('theme_test_template_test'), 'Offset was returned correctly from the theme registry.'); + $this->assertNotEmpty($registry->get('theme_test_template_test'), 'Offset was returned correctly from the theme registry.'); // This will cause the ThemeRegistry class to write an updated version of // the cache entry when it is destroyed, usually at the end of the request. // Before that happens, manually delete the cache entry we created earlier @@ -50,14 +50,14 @@ function testRaceCondition() { // Destroy the class so that it triggers a cache write for the offset. $registry->destruct(); - $this->assertTrue(\Drupal::cache()->get($cid), 'Cache entry was created.'); + $this->assertNotEmpty(\Drupal::cache()->get($cid), 'Cache entry was created.'); // Create a new instance of the class. Confirm that both the offset // requested previously, and one that has not yet been requested are both // available. $registry = new ThemeRegistry($cid, $cache, $lock_backend, array('theme_registry'), $this->container->get('module_handler')->isLoaded()); - $this->assertTrue($registry->get('theme_test_template_test'), 'Offset was returned correctly from the theme registry'); - $this->assertTrue($registry->get('theme_test_template_test_2'), 'Offset was returned correctly from the theme registry'); + $this->assertNotEmpty($registry->get('theme_test_template_test'), 'Offset was returned correctly from the theme registry'); + $this->assertNotEmpty($registry->get('theme_test_template_test_2'), 'Offset was returned correctly from the theme registry'); } /**