diff --git a/core/modules/action/tests/src/Functional/ActionUninstallTest.php b/core/modules/action/tests/src/Functional/ActionUninstallTest.php
index 6b52643..596f95f 100644
--- 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(['administer users']);
     $this->drupalLogin($admin_user);
diff --git a/core/modules/action/tests/src/Functional/BulkFormTest.php b/core/modules/action/tests/src/Functional/BulkFormTest.php
index 439ffe4..d77a72f 100644
--- 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]', [':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, [], t('Delete'));
     $this->assertText(t('Deleted 5 posts.'));
     // Check if we got redirected to the original page.
diff --git a/core/modules/action/tests/src/Functional/ConfigurationTest.php b/core/modules/action/tests/src/Functional/ConfigurationTest.php
index a260c07..3d14ca6 100644
--- a/core/modules/action/tests/src/Functional/ConfigurationTest.php
+++ b/core/modules/action/tests/src/Functional/ConfigurationTest.php
@@ -84,7 +84,7 @@ public 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($action_id);
-    $this->assertFalse($action, 'Make sure the action is gone after being deleted.');
+    $this->assertNull($action, 'Make sure the action is gone after being deleted.');
   }
 
 }
diff --git a/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php b/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
index ddd98bb..2b7f0de 100644
--- a/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
+++ b/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
@@ -210,7 +210,7 @@ public function deleteFeedItems(FeedInterface $feed) {
   public function updateAndDelete(FeedInterface $feed, $expected_count) {
     $this->updateFeedItems($feed, $expected_count);
     $count = db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', [':fid' => $feed->id()])->fetchField();
-    $this->assertTrue($count);
+    $this->assertNotEmpty($count);
     $this->deleteFeedItems($feed);
     $count = db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', [':fid' => $feed->id()])->fetchField();
     $this->assertTrue($count == 0);
diff --git a/core/modules/aggregator/tests/src/Functional/DeleteFeedTest.php b/core/modules/aggregator/tests/src/Functional/DeleteFeedTest.php
index 7d75696..cf1b5aa 100644
--- a/core/modules/aggregator/tests/src/Functional/DeleteFeedTest.php
+++ b/core/modules/aggregator/tests/src/Functional/DeleteFeedTest.php
@@ -44,7 +44,7 @@ public function testDeleteFeed() {
 
     // Check database for feed.
     $result = db_query("SELECT COUNT(*) FROM {aggregator_feed} WHERE title = :title AND url = :url", [':title' => $feed1->label(), ':url' => $feed1->getUrl()])->fetchField();
-    $this->assertFalse($result, 'Feed not found in database');
+    $this->assertEmpty($result, 'Feed not found in database');
   }
 
 }
diff --git a/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php b/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php
index fd20823..57196a5 100644
--- a/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php
+++ b/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php
@@ -47,7 +47,7 @@ public function testAggregatorFeedImport() {
     $this->assertNull($feed->getImage());
     // As with getLastCheckedTime(), the etag can change as the fixture is
     // updated normally, so assert that its format is correct.
-    $this->assertTrue(preg_match('/^"[a-z0-9]{32}"$/', $feed->getEtag()));
+    $this->assertNotEmpty(preg_match('/^"[a-z0-9]{32}"$/', $feed->getEtag()));
     $this->assertIdentical('0', $feed->getLastModified());
   }
 
diff --git a/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php b/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php
index 778f3db..f7447fa 100644
--- a/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php
+++ b/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php
@@ -34,7 +34,7 @@ public 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", [':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.', ['%ip' => $edit['ip']]), 'IP address was banned.');
 
     // Try to block an IP address that's already blocked.
@@ -65,7 +65,7 @@ public function testIPAddressValidation() {
     $submit_ip = '1.2.3.4';
     $this->drupalPostForm('admin/config/people/ban/' . $submit_ip, [], t('Add'));
     $ip = db_query("SELECT iid from {ban_ip} WHERE ip = :ip", [':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.', ['%ip' => $submit_ip]), 'IP address was banned.');
 
     // Submit your own IP address. This fails, although it works when testing
diff --git a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
index b197a76..e0507cd 100644
--- a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
+++ b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
@@ -40,7 +40,7 @@ public function testBasicAuth() {
     $this->assertText($account->getUsername(), 'Account name is displayed.');
     $this->assertResponse('200', 'HTTP response is OK');
     $this->mink->resetSessions();
-    $this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'));
+    $this->assertNull($this->drupalGetHeader('X-Drupal-Cache'));
     $this->assertIdentical(strpos($this->drupalGetHeader('Cache-Control'), 'public'), FALSE, 'Cache-Control is not set to public');
 
     $this->basicAuthGet($url, $account->getUsername(), $this->randomMachineName());
@@ -68,7 +68,7 @@ public function testBasicAuth() {
     $this->drupalGet($url);
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS');
     $this->basicAuthGet($url, $account->getUsername(), $account->pass_raw);
-    $this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'));
+    $this->assertNull($this->drupalGetHeader('X-Drupal-Cache'));
     $this->assertIdentical(strpos($this->drupalGetHeader('Cache-Control'), 'public'), FALSE, 'No page cache response when requesting a cached page with basic auth credentials.');
   }
 
diff --git a/core/modules/block/tests/src/Functional/BlockUiTest.php b/core/modules/block/tests/src/Functional/BlockUiTest.php
index e6c1875..8debf58 100644
--- a/core/modules/block/tests/src/Functional/BlockUiTest.php
+++ b/core/modules/block/tests/src/Functional/BlockUiTest.php
@@ -305,11 +305,11 @@ public function testBlockValidateErrors() {
     $arguments = [':message' => 'Only digits are allowed'];
     $pattern = '//div[contains(@class,"messages messages--error")]/div[contains(text()[2],:message)]';
     $elements = $this->xpath($pattern, $arguments);
-    $this->assertTrue($elements, 'Plugin error message found in parent form.');
+    $this->assertNotEmpty($elements, 'Plugin error message found in parent form.');
 
     $error_class_pattern = '//div[contains(@class,"form-item-settings-digits")]/input[contains(@class,"error")]';
     $error_class = $this->xpath($error_class_pattern);
-    $this->assertTrue($error_class, 'Plugin error class found in parent form.');
+    $this->assertNotEmpty($error_class, 'Plugin error class found in parent form.');
   }
 
   /**
diff --git a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
index d122099..d50c4e6 100644
--- a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
+++ b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
@@ -154,10 +154,10 @@ public function testDeleteBlockDisplay() {
     $view->displayHandlers->remove('block_1');
     $view->storage->save();
 
-    $this->assertFalse($block_storage->load($block_1->id()), 'The block for this display was removed.');
-    $this->assertFalse($block_storage->load($block_2->id()), 'The block for this display was removed.');
-    $this->assertTrue($block_storage->load($block_3->id()), 'A block from another view was unaffected.');
-    $this->assertTrue($block_storage->load($block_4->id()), 'A block from another view was unaffected.');
+    $this->assertNull($block_storage->load($block_1->id()), 'The block for this display was removed.');
+    $this->assertNull($block_storage->load($block_2->id()), 'The block for this display was removed.');
+    $this->assertNotEmpty($block_storage->load($block_3->id()), 'A block from another view was unaffected.');
+    $this->assertNotEmpty($block_storage->load($block_4->id()), 'A block from another view was unaffected.');
     $this->drupalGet('test-page');
     $this->assertNoBlockAppears($block_1);
     $this->assertNoBlockAppears($block_2);
@@ -171,8 +171,8 @@ public function testDeleteBlockDisplay() {
     $view->displayHandlers->remove('block_1');
     $view->storage->save();
 
-    $this->assertFalse($block_storage->load($block_3->id()), 'The block for this display was removed.');
-    $this->assertTrue($block_storage->load($block_4->id()), 'A block from another display on the same view was unaffected.');
+    $this->assertNull($block_storage->load($block_3->id()), 'The block for this display was removed.');
+    $this->assertNotEmpty($block_storage->load($block_4->id()), 'A block from another display on the same view was unaffected.');
     $this->drupalGet('test-page');
     $this->assertNoBlockAppears($block_3);
     $this->assertBlockAppears($block_4);
diff --git a/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php b/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php
index 2a7c771..86e2743 100644
--- a/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php
@@ -117,7 +117,7 @@ protected function loadTests() {
     $this->assertSame('content', $entity->getRegion());
     $this->assertTrue($entity->status());
     $this->assertEqual($entity->getTheme(), 'stark');
-    $this->assertTrue($entity->uuid());
+    $this->assertNotEmpty($entity->uuid());
   }
 
   /**
diff --git a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
index 71c4f55..2f26e20 100644
--- a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
@@ -155,7 +155,7 @@ protected function verifyRenderCacheHandling() {
     $build = $this->getBlockRenderArray();
     $cid = 'entity_view:block:test_block:' . implode(':', \Drupal::service('cache_contexts_manager')->convertTokensToKeys(['languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'user.permissions'])->getKeys());
     $this->renderer->renderRoot($build);
-    $this->assertTrue($this->container->get('cache.render')->get($cid), 'The block render element has been cached.');
+    $this->assertNotEmpty($this->container->get('cache.render')->get($cid), 'The block render element has been cached.');
 
     // Re-save the block and check that the cache entry has been deleted.
     $this->block->save();
@@ -169,7 +169,7 @@ protected function verifyRenderCacheHandling() {
     $build['#block'] = $this->block;
 
     $this->renderer->renderRoot($build);
-    $this->assertTrue($this->container->get('cache.render')->get($cid), 'The block render element has been cached.');
+    $this->assertNotEmpty($this->container->get('cache.render')->get($cid), 'The block render element has been cached.');
     $this->block->delete();
     $this->assertFalse($this->container->get('cache.render')->get($cid), 'The block render cache entry has been cleared when the block was deleted.');
 
@@ -306,7 +306,7 @@ protected function assertBlockRenderedWithExpectedCacheability(array $expected_k
     $final_cache_contexts = Cache::mergeContexts($expected_contexts, $required_cache_contexts);
     $cid = implode(':', $expected_keys) . ':' . implode(':', \Drupal::service('cache_contexts_manager')->convertTokensToKeys($final_cache_contexts)->getKeys());
     $cache_item = $this->container->get('cache.render')->get($cid);
-    $this->assertTrue($cache_item, 'The block render element has been cached with the expected cache ID.');
+    $this->assertNotEmpty($cache_item, 'The block render element has been cached with the expected cache ID.');
     $this->assertIdentical(Cache::mergeTags($expected_tags, ['rendered']), $cache_item->tags);
     $this->assertIdentical($final_cache_contexts, $cache_item->data['#cache']['contexts']);
     $this->assertIdentical($expected_tags, $cache_item->data['#cache']['tags']);
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
index 562a4bd..bb1b0e1 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
@@ -65,7 +65,7 @@ public function testBlockContentCreation() {
     // Check that the block exists in the database.
     $blocks = entity_load_multiple_by_properties('block_content', ['info' => $edit['info[0][value]']]);
     $block = reset($blocks);
-    $this->assertTrue($block, 'Custom Block found in database.');
+    $this->assertNotEmpty($block, 'Custom Block found in database.');
 
     // Check that attempting to create another block with the same value for
     // 'info' returns an error.
@@ -145,7 +145,7 @@ public function testBlockContentCreationMultipleViewModes() {
     // Check that the block exists in the database.
     $blocks = entity_load_multiple_by_properties('block_content', ['info' => $edit['info[0][value]']]);
     $block = reset($blocks);
-    $this->assertTrue($block, 'Custom Block found in database.');
+    $this->assertNotEmpty($block, 'Custom Block found in database.');
 
     // Check that attempting to create another block with the same value for
     // 'info' returns an error.
@@ -180,7 +180,7 @@ public function testDefaultBlockContentCreation() {
     // Check that the block exists in the database.
     $blocks = entity_load_multiple_by_properties('block_content', ['info' => $edit['info[0][value]']]);
     $block = reset($blocks);
-    $this->assertTrue($block, 'Default Custom Block found in database.');
+    $this->assertNotEmpty($block, 'Default Custom Block found in database.');
   }
 
   /**
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentListTest.php b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
index aba60c3..4c6a1c2 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
@@ -32,7 +32,7 @@ public function testListing() {
 
     // Test for the table.
     $element = $this->xpath('//div[@class="layout-content"]//table');
-    $this->assertTrue($element, 'Configuration entity list table found.');
+    $this->assertNotEmpty($element, 'Configuration entity list table found.');
 
     // Test the table header.
     $elements = $this->xpath('//div[@class="layout-content"]//table/thead/tr/th');
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
index 1c623be..db4f6fd 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
@@ -34,7 +34,7 @@ public function testListing() {
 
     // Test for the table.
     $element = $this->xpath('//div[@class="layout-content"]//table');
-    $this->assertTrue($element, 'Views table found.');
+    $this->assertNotEmpty($element, 'Views table found.');
 
     // Test the table header.
     $elements = $this->xpath('//div[@class="layout-content"]//table/thead/tr/th');
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php b/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php
index 0f7ae5a..4e10e48 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php
@@ -50,7 +50,7 @@ public function testImport() {
 
     // Test the import saved.
     $block_by_id = BlockContent::load($test_id);
-    $this->assertTrue($block_by_id, 'Custom block load by block ID.');
+    $this->assertNotEmpty($block_by_id, 'Custom block load by block ID.');
     $this->assertIdentical($block_by_id->body->value, $block_array['body']['value']);
   }
 
diff --git a/core/modules/block_content/tests/src/Functional/PageEditTest.php b/core/modules/block_content/tests/src/Functional/PageEditTest.php
index 41638bd..4522f32 100644
--- a/core/modules/block_content/tests/src/Functional/PageEditTest.php
+++ b/core/modules/block_content/tests/src/Functional/PageEditTest.php
@@ -35,7 +35,7 @@ public function testPageEdit() {
     // Check that the block exists in the database.
     $blocks = \Drupal::entityQuery('block_content')->condition('info', $edit['info[0][value]'])->execute();
     $block = BlockContent::load(reset($blocks));
-    $this->assertTrue($block, 'Custom block found in database.');
+    $this->assertNotEmpty($block, 'Custom block found in database.');
 
     // Load the edit page.
     $this->drupalGet('block/' . $block->id());
diff --git a/core/modules/book/tests/src/Functional/BookContentModerationTest.php b/core/modules/book/tests/src/Functional/BookContentModerationTest.php
index 5d6a340..ae79c9d 100644
--- a/core/modules/book/tests/src/Functional/BookContentModerationTest.php
+++ b/core/modules/book/tests/src/Functional/BookContentModerationTest.php
@@ -64,7 +64,7 @@ public function testBookWithPendingRevisions() {
     ];
     $this->drupalPostForm('node/add/book', $edit, t('Save'));
     $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
-    $this->assertTrue($node);
+    $this->assertNotEmpty($node);
 
     $edit = [
       'moderation_state[0][state]' => 'draft',
diff --git a/core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php b/core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php
index ce3411c..2e2f227 100644
--- a/core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php
+++ b/core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php
@@ -56,7 +56,7 @@ public function testExistingFormat() {
 
     // Ensure no Editor config entity exists yet.
     $editor = Editor::load('filtered_html');
-    $this->assertFalse($editor, 'No Editor config entity exists yet.');
+    $this->assertNull($editor, 'No Editor config entity exists yet.');
 
     // Verify the "Text Editor" <select> when a text editor is available.
     $select = $this->xpath('//select[@name="editor[editor]"]');
@@ -112,7 +112,7 @@ public function testExistingFormat() {
     // Keep the "CKEditor" editor selected and click the "Configure" button.
     $this->drupalPostForm(NULL, $edit, 'editor_configure');
     $editor = Editor::load('filtered_html');
-    $this->assertFalse($editor, 'No Editor config entity exists yet.');
+    $this->assertNull($editor, 'No Editor config entity exists yet.');
 
     // Ensure that drupalSettings is correct.
     $ckeditor_settings_toolbar = [
@@ -248,9 +248,9 @@ public function testNewFormat() {
     ];
     $this->drupalPostForm(NULL, $edit, 'editor_configure');
     $filter_format = FilterFormat::load('amazing_format');
-    $this->assertFalse($filter_format, 'No FilterFormat config entity exists yet.');
+    $this->assertNull($filter_format, 'No FilterFormat config entity exists yet.');
     $editor = Editor::load('amazing_format');
-    $this->assertFalse($editor, 'No Editor config entity exists yet.');
+    $this->assertNull($editor, 'No Editor config entity exists yet.');
 
     // Ensure the toolbar buttons configuration value is initialized to the
     // default value.
diff --git a/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php b/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php
index 7e2ba62..3e08c86 100644
--- a/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php
+++ b/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php
@@ -38,7 +38,7 @@ public function testCommentAdminPostUpdateHook() {
     /** @var \Drupal\views\ViewEntityInterface $comment_admin_view */
     $comment_admin_view = $entity_type_manager->getStorage('view')->load('comment');
     $this->assertNotNull($comment_admin_view, 'Comment admin view exist in storage.');
-    $this->assertTrue($comment_admin_view->enable(), 'Comment admin view is enabled.');
+    $this->assertTrue((bool) $comment_admin_view->enable()->get('status'), 'Comment admin view is enabled.');
     $comment_delete_action = $entity_type_manager->getStorage('action')->load('comment_delete_action');
     $this->assertNotNull($comment_delete_action, 'Comment delete action imported');
     // Verify comment admin page is working after updates.
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableInstanceTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableInstanceTest.php
index 90b256f..94e1a20 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableInstanceTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableInstanceTest.php
@@ -42,9 +42,9 @@ public function testCommentFieldInstance() {
     $settings = $node->comment->getFieldDefinition()->getSettings();
     $this->assertIdentical(CommentManagerInterface::COMMENT_MODE_THREADED, $settings['default_mode']);
     $this->assertIdentical(50, $settings['per_page']);
-    $this->assertFalse($settings['anonymous']);
+    $this->assertEmpty($settings['anonymous']);
     $this->assertFalse($settings['form_location']);
-    $this->assertTrue($settings['preview']);
+    $this->assertNotEmpty($settings['preview']);
 
     $node = Node::create(['type' => 'story']);
     $this->assertIdentical(2, $node->comment_no_subject->status);
@@ -52,9 +52,9 @@ public function testCommentFieldInstance() {
     $settings = $node->comment_no_subject->getFieldDefinition()->getSettings();
     $this->assertIdentical(CommentManagerInterface::COMMENT_MODE_FLAT, $settings['default_mode']);
     $this->assertIdentical(70, $settings['per_page']);
-    $this->assertTrue($settings['anonymous']);
+    $this->assertNotEmpty($settings['anonymous']);
     $this->assertFalse($settings['form_location']);
-    $this->assertFalse($settings['preview']);
+    $this->assertEmpty($settings['preview']);
   }
 
 }
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php
index cc82c82..cc63781 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php
@@ -60,7 +60,7 @@ protected function assertEntity($id, $field_name, $bundle, $default_mode, $per_p
     $this->assertTrue($entity->isRequired());
     $this->assertIdentical($field_name, $entity->getFieldStorageDefinition()->getName());
     $this->assertIdentical($bundle, $entity->getTargetBundle());
-    $this->assertTrue($entity->get('default_value')[0]['status']);
+    $this->assertEquals(1, $entity->get('default_value')[0]['status']);
     $this->assertEqual($default_mode, $entity->getSetting('default_mode'));
     $this->assertIdentical($per_page, $entity->getSetting('per_page'));
     $this->assertEqual($anonymous, $entity->getSetting('anonymous'));
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php
index 42c2a30..244fd72 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php
@@ -56,7 +56,7 @@ public function testCommentMigration() {
     $this->assertIdentical('A comment', $comment->getSubject());
     $this->assertIdentical('1421727536', $comment->getCreatedTime());
     $this->assertIdentical('1421727536', $comment->getChangedTime());
-    $this->assertTrue($comment->getStatus());
+    $this->assertEquals(1, $comment->getStatus());
     $this->assertIdentical('admin', $comment->getAuthorName());
     $this->assertIdentical('admin@local.host', $comment->getAuthorEmail());
     $this->assertIdentical('This is a comment', $comment->comment_body->value);
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
index ffb91b0..e4e7a0a 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
@@ -72,7 +72,7 @@ public function testLinkApprove() {
 
     // Check if I can see the comment approve link on an approved comment.
     $approve_comment = $view->style_plugin->getField(1, 'approve_comment');
-    $this->assertFalse((string) $approve_comment, "Didn't find a comment approve link for an already approved comment.");
+    $this->assertEmpty((string) $approve_comment, "Didn't find a comment approve link for an already approved comment.");
 
     // Check if I can see the comment approve link on an approved comment as an
     // anonymous user.
@@ -84,7 +84,7 @@ public function testLinkApprove() {
     $view = Views::getView('test_comment');
     $view->preview();
     $replyto_comment = $view->style_plugin->getField(0, 'approve_comment');
-    $this->assertFalse((string) $replyto_comment, "I can't approve the comment as an anonymous user.");
+    $this->assertEmpty((string) $replyto_comment, "I can't approve the comment as an anonymous user.");
   }
 
   /**
@@ -147,7 +147,7 @@ public function testLinkReply() {
 
     // Check if I can see the reply link on an unapproved comment.
     $replyto_comment = $view->style_plugin->getField(0, 'replyto_comment');
-    $this->assertFalse((string) $replyto_comment, "I can't reply to an unapproved comment.");
+    $this->assertEmpty((string) $replyto_comment, "I can't reply to an unapproved comment.");
 
     // Approve the comment.
     $comment->setPublished(CommentInterface::PUBLISHED);
@@ -170,7 +170,7 @@ public function testLinkReply() {
     $view = Views::getView('test_comment');
     $view->preview();
     $replyto_comment = $view->style_plugin->getField(0, 'replyto_comment');
-    $this->assertFalse((string) $replyto_comment, "Didn't find the comment reply link as an anonymous user.");
+    $this->assertEmpty((string) $replyto_comment, "Didn't find the comment reply link as an anonymous user.");
   }
 
 }
diff --git a/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php b/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
index 696a36e..7b076b2 100644
--- a/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
@@ -67,7 +67,7 @@ public function testConfigDependencyDeleteFormTrait() {
     $this->assertText($entity2->id(), 'Entity2 id found');
     $this->drupalPostForm($entity1->urlInfo('delete-form'), [], 'Delete');
     $storage->resetCache();
-    $this->assertFalse($storage->loadMultiple([$entity1->id(), $entity2->id()]), 'Test entities deleted');
+    $this->assertEmpty($storage->loadMultiple([$entity1->id(), $entity2->id()]), 'Test entities deleted');
 
     // Set a more complicated test where dependencies will be fixed.
     // Entity1 will be deleted by the test.
@@ -117,12 +117,12 @@ public function testConfigDependencyDeleteFormTrait() {
     $this->assertNoText($entity3->id(), 'Entity3 id not found');
     $this->drupalPostForm($entity1->urlInfo('delete-form'), [], 'Delete');
     $storage->resetCache();
-    $this->assertFalse($storage->load('entity1'), 'Test entity 1 deleted');
+    $this->assertNull($storage->load('entity1'), 'Test entity 1 deleted');
     $entity2 = $storage->load('entity2');
-    $this->assertTrue($entity2, 'Entity 2 not deleted');
+    $this->assertNotEmpty($entity2, 'Entity 2 not deleted');
     $this->assertEqual($entity2->calculateDependencies()->getDependencies()['config'], [], 'Entity 2 dependencies updated to remove dependency on Entity1.');
     $entity3 = $storage->load('entity3');
-    $this->assertTrue($entity3, 'Entity 3 not deleted');
+    $this->assertNotEmpty($entity3, 'Entity 3 not deleted');
     $this->assertEqual($entity3->calculateDependencies()->getDependencies()['config'], [$entity2->getConfigDependencyName()], 'Entity 3 still depends on Entity 2.');
 
   }
diff --git a/core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php b/core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php
index a996760..2b38576 100644
--- a/core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php
@@ -26,7 +26,7 @@ public function testInstallOtherModuleFirst() {
     // Install the module that provides the entity type. This installs the
     // default configuration.
     $this->installModule('config_test');
-    $this->assertTrue(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration has been installed.');
+    $this->assertNotEmpty(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration has been installed.');
 
     // Uninstall the module that provides the entity type. This will remove the
     // default configuration.
@@ -38,7 +38,7 @@ public function testInstallOtherModuleFirst() {
     // default configuration.
     $this->installModule('config_test');
     $other_module_config_entity = entity_load('config_test', 'other_module_test', TRUE);
-    $this->assertTrue($other_module_config_entity, "Default configuration has been recreated.");
+    $this->assertNotEmpty($other_module_config_entity, "Default configuration has been recreated.");
 
     // Update the default configuration to test that the changes are preserved
     // if the module that provides the default configuration is uninstalled.
@@ -47,10 +47,10 @@ public function testInstallOtherModuleFirst() {
 
     // Uninstall the module that provides the default configuration.
     $this->uninstallModule('config_other_module_config_test');
-    $this->assertTrue(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration for other modules is not removed when the module that provides it is uninstalled.');
+    $this->assertNotEmpty(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration for other modules is not removed when the module that provides it is uninstalled.');
 
     // Default configuration provided by config_test should still exist.
-    $this->assertTrue(entity_load('config_test', 'dotted.default', TRUE), 'The configuration is not deleted.');
+    $this->assertNotEmpty(entity_load('config_test', 'dotted.default', TRUE), 'The configuration is not deleted.');
 
     // Re-enable module to test that pre-existing optional configuration does
     // not throw an error.
@@ -63,7 +63,7 @@ public function testInstallOtherModuleFirst() {
     $this->assertNull(entity_load('config_test', 'other_module_test_optional_entity_unmet', TRUE), 'The optional configuration config_test.dynamic.other_module_test_optional_entity_unmet whose dependencies are not met is not created.');
     $this->installModule('config_test_language');
     $this->installModule('config_install_dependency_test');
-    $this->assertTrue(entity_load('config_test', 'other_module_test_unmet', TRUE), 'The optional configuration config_test.dynamic.other_module_test_unmet whose dependencies are met is now created.');
+    $this->assertNotEmpty(entity_load('config_test', 'other_module_test_unmet', TRUE), 'The optional configuration config_test.dynamic.other_module_test_unmet whose dependencies are met is now created.');
     // Although the following configuration entity's are now met it is not
     // installed because it does not have a direct dependency on the
     // config_install_dependency_test module.
@@ -75,10 +75,10 @@ public function testInstallOtherModuleFirst() {
    */
   public function testInstallConfigEntityModuleFirst() {
     $this->installModule('config_test');
-    $this->assertFalse(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration provided by config_other_module_config_test does not exist.');
+    $this->assertNull(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration provided by config_other_module_config_test does not exist.');
 
     $this->installModule('config_other_module_config_test');
-    $this->assertTrue(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration provided by config_other_module_config_test has been installed.');
+    $this->assertNotEmpty(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration provided by config_other_module_config_test has been installed.');
   }
 
   /**
diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
index 5f6e8e6..6ae11e7 100644
--- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
@@ -210,10 +210,10 @@ public function testPersonalContactAccess() {
     // form.
     $this->drupalGet('user/' . $this->webUser->id() . '/edit');
     $this->assertNoFieldChecked('edit-contact--2');
-    $this->assertFalse(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form disabled');
+    $this->assertNull(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form disabled');
     $this->drupalPostForm(NULL, ['contact' => TRUE], t('Save'));
     $this->assertFieldChecked('edit-contact--2');
-    $this->assertTrue(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form enabled');
+    $this->assertNotEmpty(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form enabled');
 
     // Test with disabled global default contact form in combination with a user
     // that has the contact form enabled.
diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
index 178a3ad..3643578 100644
--- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
@@ -49,10 +49,10 @@ public function testSiteWideContact() {
     $this->drupalGet('contact');
 
     // Ensure that there is no textfield for name.
-    $this->assertFalse($this->xpath('//input[@name=:name]', [':name' => 'name']));
+    $this->assertEmpty($this->xpath('//input[@name=:name]', [':name' => 'name']));
 
     // Ensure that there is no textfield for email.
-    $this->assertFalse($this->xpath('//input[@name=:name]', [':name' => 'mail']));
+    $this->assertEmpty($this->xpath('//input[@name=:name]', [':name' => 'mail']));
 
     // Logout and retrieve the page as an anonymous user
     $this->drupalLogout();
@@ -60,10 +60,10 @@ public function testSiteWideContact() {
     $this->drupalGet('contact');
 
     // Ensure that there is textfield for name.
-    $this->assertTrue($this->xpath('//input[@name=:name]', [':name' => 'name']));
+    $this->assertNotEmpty($this->xpath('//input[@name=:name]', [':name' => 'name']));
 
     // Ensure that there is textfield for email.
-    $this->assertTrue($this->xpath('//input[@name=:name]', [':name' => 'mail']));
+    $this->assertNotEmpty($this->xpath('//input[@name=:name]', [':name' => 'mail']));
 
     // Create and log in administrative user.
     $admin_user = $this->drupalCreateUser([
@@ -323,8 +323,8 @@ public function testSiteWideContact() {
     $mails = $this->getMails();
     $mail = array_pop($mails);
     $this->assertEqual($mail['subject'], t('[@label] @subject', ['@label' => $label, '@subject' => $edit['subject[0][value]']]));
-    $this->assertTrue(strpos($mail['body'], $field_label));
-    $this->assertTrue(strpos($mail['body'], $edit[$field_name . '[0][value]']));
+    $this->assertNotEmpty(strpos($mail['body'], $field_label));
+    $this->assertNotEmpty(strpos($mail['body'], $edit[$field_name . '[0][value]']));
 
     // Test messages and redirect.
     /** @var \Drupal\contact\ContactFormInterface $form */
@@ -566,7 +566,7 @@ public function deleteContactForms() {
       else {
         $this->drupalPostForm("admin/structure/contact/manage/$id/delete", [], t('Delete'));
         $this->assertRaw(t('The contact form %label has been deleted.', ['%label' => $contact_form->label()]));
-        $this->assertFalse(ContactForm::load($id), format_string('Form %contact_form not found', ['%contact_form' => $contact_form->label()]));
+        $this->assertNull(ContactForm::load($id), format_string('Form %contact_form not found', ['%contact_form' => $contact_form->label()]));
       }
     }
   }
diff --git a/core/modules/contact/tests/src/Functional/Update/ContactUpdateTest.php b/core/modules/contact/tests/src/Functional/Update/ContactUpdateTest.php
index 676f938..c828ff9 100644
--- a/core/modules/contact/tests/src/Functional/Update/ContactUpdateTest.php
+++ b/core/modules/contact/tests/src/Functional/Update/ContactUpdateTest.php
@@ -30,7 +30,7 @@ public function testPostUpdateContactFormFields() {
     $config_factory = \Drupal::configFactory();
     // Check that contact_form entities are more than zero.
     $contact_forms = $config_factory->listAll('contact.form.');
-    $this->assertTrue(count($contact_forms), 'There are contact forms to update.');
+    $this->assertNotEmpty(count($contact_forms), 'There are contact forms to update.');
     foreach ($contact_forms as $contact_config_name) {
       $contact_form_data = $config_factory->get($contact_config_name)->get();
       $this->assertFalse(isset($contact_form_data['message']), 'Prior to running the update the "message" key does not exist.');
diff --git a/core/modules/contact/tests/src/Functional/Views/ContactFieldsTest.php b/core/modules/contact/tests/src/Functional/Views/ContactFieldsTest.php
index c66b5ad..165bd0c 100644
--- a/core/modules/contact/tests/src/Functional/Views/ContactFieldsTest.php
+++ b/core/modules/contact/tests/src/Functional/Views/ContactFieldsTest.php
@@ -59,7 +59,7 @@ public function testViewsData() {
     // entities have no storage.
     $table_name = 'contact_message__' . $this->fieldStorage->getName();
     $data = $this->container->get('views.views_data')->get($table_name);
-    $this->assertFalse($data, 'The field is not exposed to Views.');
+    $this->assertEmpty($data, 'The field is not exposed to Views.');
   }
 
 }
diff --git a/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php b/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
index c3b68f0..4d91f68 100644
--- a/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
+++ b/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
@@ -101,7 +101,7 @@ public function assertContactLinks(array $accounts, array $names) {
       $account = $accounts[$name];
 
       $result = $this->xpath('//div[contains(@class, "views-field-contact")]//a[contains(@href, :url)]', [':url' => $account->url('contact-form')]);
-      $this->assertTrue(count($result));
+      $this->assertNotEmpty(count($result));
     }
   }
 
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
index a284b5a..2870581 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
@@ -250,10 +250,10 @@ public function testContentTranslationNodeForm() {
       'body[0][value]' => 'First version of the content.',
       'moderation_state[0][state]' => 'draft',
     ], t('Save'));
-    $this->assertTrue($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertNotEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     $node = $this->drupalGetNodeByTitle('Some moderated content');
-    $this->assertTrue($node->language(), 'en');
+    $this->assertNotEmpty($node->language(), 'en');
     $edit_path = sprintf('node/%d/edit', $node->id());
     $translate_path = sprintf('node/%d/translations/add/en/fr', $node->id());
     $latest_version_path = sprintf('node/%d/latest', $node->id());
@@ -261,7 +261,7 @@ public function testContentTranslationNodeForm() {
 
     $this->drupalGet($latest_version_path);
     $this->assertSession()->statusCodeEquals('403');
-    $this->assertFalse($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // Add french translation (revision 2).
     $this->drupalGet($translate_path);
@@ -275,7 +275,7 @@ public function testContentTranslationNodeForm() {
 
     $this->drupalGet($latest_version_path, ['language' => $french]);
     $this->assertSession()->statusCodeEquals('403');
-    $this->assertFalse($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // Add french pending revision (revision 3).
     $this->drupalGet($edit_path, ['language' => $french]);
@@ -288,7 +288,7 @@ public function testContentTranslationNodeForm() {
     ], t('Save (this translation)'));
 
     $this->drupalGet($latest_version_path, ['language' => $french]);
-    $this->assertTrue($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertNotEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // It should not be possible to add a new english revision.
     $this->drupalGet($edit_path);
@@ -303,7 +303,7 @@ public function testContentTranslationNodeForm() {
     $this->assertSession()->buttonExists('Delete');
 
     $this->drupalGet($latest_version_path);
-    $this->assertFalse($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // Publish the french pending revision (revision 4).
     $this->drupalGet($edit_path, ['language' => $french]);
@@ -316,7 +316,7 @@ public function testContentTranslationNodeForm() {
     ], t('Save (this translation)'));
 
     $this->drupalGet($latest_version_path, ['language' => $french]);
-    $this->assertFalse($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // Now we can publish the english (revision 5).
     $this->drupalGet($edit_path);
@@ -329,7 +329,7 @@ public function testContentTranslationNodeForm() {
     ], t('Save (this translation)'));
 
     $this->drupalGet($latest_version_path);
-    $this->assertFalse($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // Make sure we're allowed to create a pending french revision.
     $this->drupalGet($edit_path, ['language' => $french]);
@@ -348,7 +348,7 @@ public function testContentTranslationNodeForm() {
     ], t('Save (this translation)'));
 
     $this->drupalGet($latest_version_path);
-    $this->assertTrue($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertNotEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // Make sure we're not allowed to create a pending french revision.
     $this->drupalGet($edit_path, ['language' => $french]);
@@ -356,7 +356,7 @@ public function testContentTranslationNodeForm() {
     $this->assertSession()->pageTextContains('Unable to save this Moderated content.');
 
     $this->drupalGet($latest_version_path, ['language' => $french]);
-    $this->assertFalse($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // We should be able to publish the english pending revision (revision 7)
     $this->drupalGet($edit_path);
@@ -369,7 +369,7 @@ public function testContentTranslationNodeForm() {
     ], t('Save (this translation)'));
 
     $this->drupalGet($latest_version_path);
-    $this->assertFalse($this->xpath('//ul[@class="entity-moderation-form"]'));
+    $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]'));
 
     // Make sure we're allowed to create a pending french revision.
     $this->drupalGet($edit_path, ['language' => $french]);
@@ -391,7 +391,7 @@ public function testContentTranslationNodeForm() {
     ], t('Save'));
 
     $node = $this->drupalGetNodeByTitle('Second moderated content');
-    $this->assertTrue($node->language(), 'en');
+    $this->assertNotEmpty($node->language(), 'en');
     $edit_path = sprintf('node/%d/edit', $node->id());
     $translate_path = sprintf('node/%d/translations/add/en/fr', $node->id());
 
@@ -417,7 +417,7 @@ public function testContentTranslationNodeForm() {
     ], t('Save'));
 
     $node = $this->drupalGetNodeByTitle('Third moderated content');
-    $this->assertTrue($node->language(), 'en');
+    $this->assertNotEmpty($node->language(), 'en');
     $edit_path = sprintf('node/%d/edit', $node->id());
     $translate_path = sprintf('node/%d/translations/add/en/fr', $node->id());
 
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
index e52bf96..c6a2c8e 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
@@ -238,7 +238,7 @@ public function testContentModerationStateDataRemoval($entity_type_id) {
     $entity = $this->reloadEntity($entity);
     $entity->delete();
     $content_moderation_state = ContentModerationState::loadFromModeratedEntity($entity);
-    $this->assertFalse($content_moderation_state);
+    $this->assertNull($content_moderation_state);
 
     // Test content moderation state revision deletion.
     /** @var \Drupal\Core\Entity\ContentEntityInterface $entity2 */
@@ -250,15 +250,15 @@ public function testContentModerationStateDataRemoval($entity_type_id) {
     $revision = clone $entity2;
     $revision->isDefaultRevision(FALSE);
     $content_moderation_state = ContentModerationState::loadFromModeratedEntity($revision);
-    $this->assertTrue($content_moderation_state);
+    $this->assertNotEmpty($content_moderation_state);
     $entity2 = $this->reloadEntity($entity2);
     $entity2->setNewRevision(TRUE);
     $entity2->save();
     $entity_storage->deleteRevision($revision->getRevisionId());
     $content_moderation_state = ContentModerationState::loadFromModeratedEntity($revision);
-    $this->assertFalse($content_moderation_state);
+    $this->assertNull($content_moderation_state);
     $content_moderation_state = ContentModerationState::loadFromModeratedEntity($entity2);
-    $this->assertTrue($content_moderation_state);
+    $this->assertNotEmpty($content_moderation_state);
 
     // Test content moderation state translation deletion.
     if ($this->entityTypeManager->getDefinition($entity_type_id)->isTranslatable()) {
diff --git a/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php b/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php
index 7e84641..a58fdd3 100644
--- a/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php
@@ -73,7 +73,7 @@ public function testPendingRevisions() {
     /** @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.
@@ -84,7 +84,7 @@ public function testPendingRevisions() {
     // 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 pending revision in Draft.
@@ -114,7 +114,7 @@ public function testPendingRevisions() {
     // 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.
@@ -124,7 +124,7 @@ public function testPendingRevisions() {
 
     $page = Node::load($id);
     $this->assertEquals('E', $page->getTitle());
-    $this->assertTrue($page->isDefaultRevision());
+    $this->assertNotEmpty($page->isDefaultRevision());
     $this->assertTrue($page->isPublished());
   }
 
@@ -146,7 +146,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());
   }
 
@@ -177,7 +177,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());
   }
 
 }
diff --git a/core/modules/content_moderation/tests/src/Kernel/EntityRevisionConverterTest.php b/core/modules/content_moderation/tests/src/Kernel/EntityRevisionConverterTest.php
index 6f209d1..e6d3321 100644
--- a/core/modules/content_moderation/tests/src/Kernel/EntityRevisionConverterTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/EntityRevisionConverterTest.php
@@ -95,7 +95,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());
   }
 
 }
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php
index 8ea652e..3f31d9d 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php
@@ -131,7 +131,7 @@ public function testCanonicalAlternateTagsMissing() {
 
     $this->assertSession()->statusCodeEquals(200);
     $result = $this->xpath('//link[@rel="alternate" and @hreflang]');
-    $this->assertFalse($result, 'No alternate link tag found.');
+    $this->assertEmpty($result, 'No alternate link tag found.');
   }
 
 }
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
index f15a8f9..eb54696 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
@@ -76,7 +76,7 @@ public function testSettingsUI() {
     ];
     $this->assertSettings('comment', 'comment_article', FALSE, $edit);
     $xpath_err = '//div[contains(@class, "error")]';
-    $this->assertTrue($this->xpath($xpath_err), 'Enabling translation only for entity bundles generates a form error.');
+    $this->assertNotEmpty($this->xpath($xpath_err), 'Enabling translation only for entity bundles generates a form error.');
 
     // Test that the translation settings are not stored if a non-configurable
     // language is set as default and the language selector is hidden.
@@ -88,7 +88,7 @@ public function testSettingsUI() {
       'settings[comment][comment_article][fields][comment_body]' => TRUE,
     ];
     $this->assertSettings('comment', 'comment_article', FALSE, $edit);
-    $this->assertTrue($this->xpath($xpath_err), 'Enabling translation with a fixed non-configurable language generates a form error.');
+    $this->assertNotEmpty($this->xpath($xpath_err), 'Enabling translation with a fixed non-configurable language generates a form error.');
 
     // Test that a field shared among different bundles can be enabled without
     // needing to make all the related bundles translatable.
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php
index 5f7c9fd..0fecb7f 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php
@@ -111,7 +111,7 @@ public function testImageFieldSync() {
     ];
     $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration'));
     $errors = $this->xpath('//div[contains(@class, "messages--error")]');
-    $this->assertFalse($errors, 'Settings correctly stored.');
+    $this->assertEmpty($errors, 'Settings correctly stored.');
     $this->assertFieldChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-alt');
     $this->assertFieldChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-title');
     $this->drupalLogin($this->translator);
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
index c755ac4..209a416 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
@@ -83,7 +83,7 @@ protected function doTestBasicTranslation() {
       ->getStorage($this->entityTypeId);
     $storage->resetCache([$this->entityId]);
     $entity = $storage->load($this->entityId);
-    $this->assertTrue($entity, 'Entity found in the database.');
+    $this->assertNotEmpty($entity, 'Entity found in the database.');
     $this->drupalGet($entity->urlInfo());
     $this->assertResponse(200, 'Entity URL is valid.');
 
@@ -260,11 +260,11 @@ protected function doTestOutdatedStatus() {
       $this->drupalGet($url);
       if ($added_langcode == $langcode) {
         $this->assertFieldByXPath('//input[@name="content_translation[retranslate]"]', FALSE, 'The retranslate flag is not checked by default.');
-        $this->assertFalse($this->xpath('//details[@id="edit-content-translation" and @open="open"]'), 'The translation tab should be collapsed by default.');
+        $this->assertEmpty($this->xpath('//details[@id="edit-content-translation" and @open="open"]'), 'The translation tab should be collapsed by default.');
       }
       else {
         $this->assertFieldByXPath('//input[@name="content_translation[outdated]"]', TRUE, 'The translate flag is checked by default.');
-        $this->assertTrue($this->xpath('//details[@id="edit-content-translation" and @open="open"]'), 'The translation tab is correctly expanded when the translation is outdated.');
+        $this->assertNotEmpty($this->xpath('//details[@id="edit-content-translation" and @open="open"]'), 'The translation tab is correctly expanded when the translation is outdated.');
         $edit = ['content_translation[outdated]' => FALSE];
         $this->drupalPostForm($url, $edit, $this->getFormSubmitAction($entity, $added_langcode));
         $this->drupalGet($url);
@@ -349,7 +349,7 @@ protected function doTestAuthoringInfo() {
       'content_translation[created]' => '19/11/1978',
     ];
     $this->drupalPostForm($entity->urlInfo('edit-form'), $edit, $this->getFormSubmitAction($entity, $langcode));
-    $this->assertTrue($this->xpath('//div[contains(@class, "error")]//ul'), 'Invalid values generate a list of form errors.');
+    $this->assertNotEmpty($this->xpath('//div[contains(@class, "error")]//ul'), 'Invalid values generate a list of form errors.');
     $metadata = $this->manager->getTranslationMetadata($entity->getTranslation($langcode));
     $this->assertEqual($metadata->getAuthor()->id(), $values[$langcode]['uid'], 'Translation author correctly kept.');
     $this->assertEqual($metadata->getCreatedTime(), $values[$langcode]['created'], 'Translation date correctly kept.');
diff --git a/core/modules/dblog/tests/src/Functional/ConnectionFailureTest.php b/core/modules/dblog/tests/src/Functional/ConnectionFailureTest.php
index 37c855a..cdb3f8b 100644
--- a/core/modules/dblog/tests/src/Functional/ConnectionFailureTest.php
+++ b/core/modules/dblog/tests/src/Functional/ConnectionFailureTest.php
@@ -37,7 +37,7 @@ public function testConnectionFailureLogging() {
     Database::getConnection();
 
     $wid = db_query("SELECT MAX(wid) FROM {watchdog} WHERE message = 'testConnectionFailureLogging'")->fetchField();
-    $this->assertTrue($wid, 'Watchdog entry has been stored in database.');
+    $this->assertNotEmpty($wid, 'Watchdog entry has been stored in database.');
   }
 
 }
diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php
index 5b82282..89c9b54 100644
--- a/core/modules/dblog/tests/src/Functional/DbLogTest.php
+++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php
@@ -158,7 +158,7 @@ private function verifyCron($row_limit) {
     // Test disabling of detailed cron logging.
     $this->config('system.cron')->set('logging', 0)->save();
     $cron_count = $this->runCron();
-    $this->assertTrue($cron_count = 1, format_string('Cron added @count of @expected new log entries', ['@count' => $cron_count, '@expected' => 1]));
+    $this->assertTrue($cron_count == 1, format_string('Cron added @count of @expected new log entries', ['@count' => $cron_count, '@expected' => 1]));
   }
 
   /**
@@ -437,7 +437,7 @@ private function doUser() {
       // Check for full message text on the details page.
       $this->assertRaw($message, 'DBLog event details was found: [delete user]');
     }
-    $this->assertTrue($link, 'DBLog event was recorded: [delete user]');
+    $this->assertNotEmpty($link, 'DBLog event was recorded: [delete user]');
     // Visit random URL (to generate page not found event).
     $not_found_url = $this->randomMachineName(60);
     $this->drupalGet($not_found_url);
diff --git a/core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php b/core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php
index ffa8f43..f117549 100644
--- a/core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php
+++ b/core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php
@@ -51,7 +51,7 @@ public function testDynamicPageCache() {
     // Cache.
     $url = Url::fromUri('route:dynamic_page_cache_test.response');
     $this->drupalGet($url);
-    $this->assertFalse($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response object returned: Dynamic Page Cache is ignoring.');
+    $this->assertNull($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response object returned: Dynamic Page Cache is ignoring.');
 
     // Controllers returning CacheableResponseInterface (cacheable response)
     // objects are handled by Dynamic Page Cache.
@@ -95,19 +95,19 @@ public function testDynamicPageCache() {
     // response, are ignored by Dynamic Page Cache (but only because those
     // wrapper formats' responses do not implement CacheableResponseInterface).
     $this->drupalGet('dynamic-page-cache-test/html', ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax']]);
-    $this->assertFalse($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Render array returned, rendered as AJAX response: Dynamic Page Cache is ignoring.');
+    $this->assertNull($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Render array returned, rendered as AJAX response: Dynamic Page Cache is ignoring.');
     $this->drupalGet('dynamic-page-cache-test/html', ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_dialog']]);
-    $this->assertFalse($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Render array returned, rendered as dialog response: Dynamic Page Cache is ignoring.');
+    $this->assertNull($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Render array returned, rendered as dialog response: Dynamic Page Cache is ignoring.');
     $this->drupalGet('dynamic-page-cache-test/html', ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_modal']]);
-    $this->assertFalse($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Render array returned, rendered as modal response: Dynamic Page Cache is ignoring.');
+    $this->assertNull($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Render array returned, rendered as modal response: Dynamic Page Cache is ignoring.');
 
     // Admin routes are ignored by Dynamic Page Cache.
     $this->drupalGet('dynamic-page-cache-test/html/admin');
-    $this->assertFalse($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response returned, rendered as HTML response, admin route: Dynamic Page Cache is ignoring');
+    $this->assertNull($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response returned, rendered as HTML response, admin route: Dynamic Page Cache is ignoring');
     $this->drupalGet('dynamic-page-cache-test/response/admin');
-    $this->assertFalse($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response returned, plain response, admin route: Dynamic Page Cache is ignoring');
+    $this->assertNull($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response returned, plain response, admin route: Dynamic Page Cache is ignoring');
     $this->drupalGet('dynamic-page-cache-test/cacheable-response/admin');
-    $this->assertFalse($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response returned, cacheable response, admin route: Dynamic Page Cache is ignoring');
+    $this->assertNull($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response returned, cacheable response, admin route: Dynamic Page Cache is ignoring');
 
     // Max-age = 0 responses are ignored by Dynamic Page Cache.
     $this->drupalGet('dynamic-page-cache-test/html/uncacheable/max-age');
diff --git a/core/modules/editor/tests/src/Functional/EditorDialogAccessTest.php b/core/modules/editor/tests/src/Functional/EditorDialogAccessTest.php
index 3a97b35..f3a82ee 100644
--- a/core/modules/editor/tests/src/Functional/EditorDialogAccessTest.php
+++ b/core/modules/editor/tests/src/Functional/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);
   }
 
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
index 90895b1..dad98eb 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
@@ -107,7 +107,7 @@ public function testAutoCreate() {
 
     $query = clone $base_query;
     $result = $query->execute();
-    $this->assertFalse($result, 'Referenced node does not exist yet.');
+    $this->assertEmpty($result, 'Referenced node does not exist yet.');
 
     $edit = [
       'title[0][value]' => $this->randomMachineName(),
@@ -118,7 +118,7 @@ public function testAutoCreate() {
     // Assert referenced node was created.
     $query = clone $base_query;
     $result = $query->execute();
-    $this->assertTrue($result, 'Referenced node was created.');
+    $this->assertNotEmpty($result, 'Referenced node was created.');
     $referenced_nid = key($result);
     $referenced_node = Node::load($referenced_nid);
 
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
index 5648470..d8cbb76 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
@@ -179,7 +179,7 @@ protected function assertFieldValues($entity_name, $referenced_entities) {
     $entity = current($this->container->get('entity_type.manager')->getStorage(
     $this->entityType)->loadByProperties(['name' => $entity_name]));
 
-    $this->assertTrue($entity, format_string('%entity_type: Entity found in the database.', ['%entity_type' => $this->entityType]));
+    $this->assertNotEmpty($entity, format_string('%entity_type: Entity found in the database.', ['%entity_type' => $this->entityType]));
 
     $this->assertEqual($entity->{$this->fieldName}->target_id, $referenced_entities[0]->id());
     $this->assertEqual($entity->{$this->fieldName}->entity->id(), $referenced_entities[0]->id());
diff --git a/core/modules/field/tests/src/Kernel/BulkDeleteTest.php b/core/modules/field/tests/src/Kernel/BulkDeleteTest.php
index 900c154..a097d36 100644
--- a/core/modules/field/tests/src/Kernel/BulkDeleteTest.php
+++ b/core/modules/field/tests/src/Kernel/BulkDeleteTest.php
@@ -198,7 +198,7 @@ public function testDeleteField() {
       ->condition('type', $bundle)
       ->condition("$field_name.deleted", 0)
       ->execute();
-    $this->assertFalse($found, 'No entities found after deleting');
+    $this->assertEmpty($found, 'No entities found after deleting');
 
     // There are 10 entities of this bundle when deleted fields are allowed, and
     // their values are correct.
@@ -208,7 +208,7 @@ public function testDeleteField() {
       ->sort('id')
       ->execute();
     $this->assertEqual(count($found), 10, 'Correct number of entities found after deleting');
-    $this->assertFalse(array_diff($found, array_keys($this->entities)));
+    $this->assertEmpty(array_diff($found, array_keys($this->entities)));
   }
 
   /**
diff --git a/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php b/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
index 03ed8cd..e96c1bb 100644
--- a/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
@@ -277,9 +277,9 @@ public function testFieldAttachDelete() {
     $controller->resetCache();
     foreach ([0, 1, 2] as $vid) {
       $revision = $controller->loadRevision($vid);
-      $this->assertFalse($revision);
+      $this->assertNull($revision);
     }
-    $this->assertFalse($controller->load($entity->id()));
+    $this->assertNull($controller->load($entity->id()));
   }
 
   /**
@@ -369,8 +369,8 @@ public function testEntityDeleteBundle() {
     $this->assertTrue(empty($entity->{$field_name}), 'No data for second field');
 
     // Verify that the fields are gone.
-    $this->assertFalse(FieldConfig::load('entity_test.' . $this->fieldTestData->field->getTargetBundle() . '.' . $this->fieldTestData->field_name), "First field is deleted");
-    $this->assertFalse(FieldConfig::load('entity_test.' . $field['bundle'] . '.' . $field_name), "Second field is deleted");
+    $this->assertNull(FieldConfig::load('entity_test.' . $this->fieldTestData->field->getTargetBundle() . '.' . $this->fieldTestData->field_name), "First field is deleted");
+    $this->assertNull(FieldConfig::load('entity_test.' . $field['bundle'] . '.' . $field_name), "Second field is deleted");
   }
 
 }
diff --git a/core/modules/field/tests/src/Kernel/FieldCrudTest.php b/core/modules/field/tests/src/Kernel/FieldCrudTest.php
index 6407be7..dddd858 100644
--- a/core/modules/field/tests/src/Kernel/FieldCrudTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldCrudTest.php
@@ -70,7 +70,7 @@ public function testCreateField() {
     $field->save();
 
     $field = FieldConfig::load($field->id());
-    $this->assertTrue($field->getSetting('field_setting_from_config_data'));
+    $this->assertEquals('TRUE', $field->getSetting('field_setting_from_config_data'));
     $this->assertNull($field->getSetting('config_data_from_field_setting'));
 
     // Read the configuration. Check against raw configuration data rather than
@@ -315,8 +315,8 @@ public function testDeleteFieldCrossDeletion() {
     FieldConfig::create($this->fieldDefinition)->save();
     FieldConfig::create($field_definition_2)->save();
     $field_storage->delete();
-    $this->assertFalse(FieldConfig::loadByName('entity_test', $this->fieldDefinition['bundle'], $field_storage->getName()));
-    $this->assertFalse(FieldConfig::loadByName('entity_test', $field_definition_2['bundle'], $field_storage->getName()));
+    $this->assertNull(FieldConfig::loadByName('entity_test', $this->fieldDefinition['bundle'], $field_storage->getName()));
+    $this->assertNull(FieldConfig::loadByName('entity_test', $field_definition_2['bundle'], $field_storage->getName()));
 
     // Check that deletion of the last field deletes the storage.
     $field_storage = FieldStorageConfig::create($this->fieldStorageDefinition);
@@ -326,9 +326,9 @@ public function testDeleteFieldCrossDeletion() {
     $field_2 = FieldConfig::create($field_definition_2);
     $field_2->save();
     $field->delete();
-    $this->assertTrue(FieldStorageConfig::loadByName('entity_test', $field_storage->getName()));
+    $this->assertNotEmpty(FieldStorageConfig::loadByName('entity_test', $field_storage->getName()));
     $field_2->delete();
-    $this->assertFalse(FieldStorageConfig::loadByName('entity_test', $field_storage->getName()));
+    $this->assertNull(FieldStorageConfig::loadByName('entity_test', $field_storage->getName()));
 
     // Check that deletion of all fields using a storage simultaneously deletes
     // the storage.
@@ -339,7 +339,7 @@ public function testDeleteFieldCrossDeletion() {
     $field_2 = FieldConfig::create($field_definition_2);
     $field_2->save();
     $this->container->get('entity.manager')->getStorage('field_config')->delete([$field, $field_2]);
-    $this->assertFalse(FieldStorageConfig::loadByName('entity_test', $field_storage->getName()));
+    $this->assertNull(FieldStorageConfig::loadByName('entity_test', $field_storage->getName()));
   }
 
 }
diff --git a/core/modules/field/tests/src/Kernel/FieldImportCreateTest.php b/core/modules/field/tests/src/Kernel/FieldImportCreateTest.php
index 5e15582..61b2fb5 100644
--- a/core/modules/field/tests/src/Kernel/FieldImportCreateTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldImportCreateTest.php
@@ -26,11 +26,11 @@ public function testImportCreateDefault() {
     $field_id_2b = "entity_test.test_bundle.$field_name_2";
 
     // Check that the field storages and fields do not exist yet.
-    $this->assertFalse(FieldStorageConfig::load($field_storage_id));
-    $this->assertFalse(FieldConfig::load($field_id));
-    $this->assertFalse(FieldStorageConfig::load($field_storage_id_2));
-    $this->assertFalse(FieldConfig::load($field_id_2a));
-    $this->assertFalse(FieldConfig::load($field_id_2b));
+    $this->assertNull(FieldStorageConfig::load($field_storage_id));
+    $this->assertNull(FieldConfig::load($field_id));
+    $this->assertNull(FieldStorageConfig::load($field_storage_id_2));
+    $this->assertNull(FieldConfig::load($field_id_2a));
+    $this->assertNull(FieldConfig::load($field_id_2b));
 
     // Create a second bundle for the 'Entity test' entity type.
     entity_test_create_bundle('test_bundle');
@@ -41,15 +41,17 @@ public function testImportCreateDefault() {
 
     // A field storage with one single field.
     $field_storage = FieldStorageConfig::load($field_storage_id);
-    $this->assertTrue($field_storage, 'The field was created.');
+    $this->assertNotEmpty($field_storage, 'The field was created.');
     $field = FieldConfig::load($field_id);
-    $this->assertTrue($field, 'The field was deleted.');
+    $this->assertNotEmpty($field, 'The field was deleted.');
 
     // A field storage with two fields.
     $field_storage_2 = FieldStorageConfig::load($field_storage_id_2);
-    $this->assertTrue($field_storage_2, 'The second field was created.');
-    $this->assertTrue($field->getTargetBundle(), 'test_bundle', 'The second field was created on bundle test_bundle.');
-    $this->assertTrue($field->getTargetBundle(), 'test_bundle_2', 'The second field was created on bundle test_bundle_2.');
+    $this->assertNotEmpty($field_storage_2, 'The second field was created.');
+    $field2a = FieldConfig::load($field_id_2a);
+    $this->assertEquals('entity_test', $field2a->getTargetBundle(), 'The second field was created on bundle entity_test.');
+    $field2b = FieldConfig::load($field_id_2b);
+    $this->assertEquals('test_bundle', $field2b->getTargetBundle(), 'The second field was created on bundle test_bundle.');
 
     // Tests fields.
     $ids = \Drupal::entityQuery('field_config')
@@ -94,26 +96,26 @@ public function testImportCreate() {
     // Add the new files to the sync directory.
     $src_dir = __DIR__ . '/../../modules/field_test_config/sync';
     $target_dir = config_get_config_directory(CONFIG_SYNC_DIRECTORY);
-    $this->assertTrue(file_unmanaged_copy("$src_dir/$field_storage_config_name.yml", "$target_dir/$field_storage_config_name.yml"));
-    $this->assertTrue(file_unmanaged_copy("$src_dir/$field_config_name.yml", "$target_dir/$field_config_name.yml"));
-    $this->assertTrue(file_unmanaged_copy("$src_dir/$field_storage_config_name_2.yml", "$target_dir/$field_storage_config_name_2.yml"));
-    $this->assertTrue(file_unmanaged_copy("$src_dir/$field_config_name_2a.yml", "$target_dir/$field_config_name_2a.yml"));
-    $this->assertTrue(file_unmanaged_copy("$src_dir/$field_config_name_2b.yml", "$target_dir/$field_config_name_2b.yml"));
+    $this->assertNotEmpty(file_unmanaged_copy("$src_dir/$field_storage_config_name.yml", "$target_dir/$field_storage_config_name.yml"));
+    $this->assertNotEmpty(file_unmanaged_copy("$src_dir/$field_config_name.yml", "$target_dir/$field_config_name.yml"));
+    $this->assertNotEmpty(file_unmanaged_copy("$src_dir/$field_storage_config_name_2.yml", "$target_dir/$field_storage_config_name_2.yml"));
+    $this->assertNotEmpty(file_unmanaged_copy("$src_dir/$field_config_name_2a.yml", "$target_dir/$field_config_name_2a.yml"));
+    $this->assertNotEmpty(file_unmanaged_copy("$src_dir/$field_config_name_2b.yml", "$target_dir/$field_config_name_2b.yml"));
 
     // Import the content of the sync directory.
     $this->configImporter()->import();
 
     // Check that the field and storage were created.
     $field_storage = FieldStorageConfig::load($field_storage_id);
-    $this->assertTrue($field_storage, 'Test import storage field from sync exists');
+    $this->assertNotEmpty($field_storage, 'Test import storage field from sync exists');
     $field = FieldConfig::load($field_id);
-    $this->assertTrue($field, 'Test import field  from sync exists');
+    $this->assertNotEmpty($field, 'Test import field  from sync exists');
     $field_storage = FieldStorageConfig::load($field_storage_id_2);
-    $this->assertTrue($field_storage, 'Test import storage field 2 from sync exists');
+    $this->assertNotEmpty($field_storage, 'Test import storage field 2 from sync exists');
     $field = FieldConfig::load($field_id_2a);
-    $this->assertTrue($field, 'Test import field 2a from sync exists');
+    $this->assertNotEmpty($field, 'Test import field 2a from sync exists');
     $field = FieldConfig::load($field_id_2b);
-    $this->assertTrue($field, 'Test import field 2b from sync exists');
+    $this->assertNotEmpty($field, 'Test import field 2b from sync exists');
   }
 
 }
diff --git a/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php b/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php
index f3408a5..32dbdbf 100644
--- a/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php
@@ -84,19 +84,19 @@ public function testImportDelete() {
     // Check that the field storages and fields are gone.
     \Drupal::entityManager()->getStorage('field_storage_config')->resetCache([$field_storage_id]);
     $field_storage = FieldStorageConfig::load($field_storage_id);
-    $this->assertFalse($field_storage, 'The field storage was deleted.');
+    $this->assertNull($field_storage, 'The field storage was deleted.');
     \Drupal::entityManager()->getStorage('field_storage_config')->resetCache([$field_storage_id_2]);
     $field_storage_2 = FieldStorageConfig::load($field_storage_id_2);
-    $this->assertFalse($field_storage_2, 'The second field storage was deleted.');
+    $this->assertNull($field_storage_2, 'The second field storage was deleted.');
     \Drupal::entityManager()->getStorage('field_config')->resetCache([$field_id]);
     $field = FieldConfig::load($field_id);
-    $this->assertFalse($field, 'The field was deleted.');
+    $this->assertNull($field, 'The field was deleted.');
     \Drupal::entityManager()->getStorage('field_config')->resetCache([$field_id_2a]);
     $field_2a = FieldConfig::load($field_id_2a);
-    $this->assertFalse($field_2a, 'The second field on test bundle was deleted.');
+    $this->assertNull($field_2a, 'The second field on test bundle was deleted.');
     \Drupal::entityManager()->getStorage('field_config')->resetCache([$field_id_2b]);
     $field_2b = FieldConfig::load($field_id_2b);
-    $this->assertFalse($field_2b, 'The second field on test bundle 2 was deleted.');
+    $this->assertNull($field_2b, 'The second field on test bundle 2 was deleted.');
 
     // Check that all config files are gone.
     $active = $this->container->get('config.storage');
diff --git a/core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php b/core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php
index c3a4d3c..60475d9 100644
--- a/core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php
@@ -100,7 +100,7 @@ public function testImportDeleteUninstall() {
     $this->configImporter()->import();
 
     $this->assertFalse(\Drupal::moduleHandler()->moduleExists('telephone'));
-    $this->assertFalse(\Drupal::entityManager()->loadEntityByUuid('field_storage_config', $field_storage->uuid()), 'The test field has been deleted by the configuration synchronization');
+    $this->assertNull(\Drupal::entityManager()->loadEntityByUuid('field_storage_config', $field_storage->uuid()), 'The test field has been deleted by the configuration synchronization');
     $deleted_storages = \Drupal::state()->get('field.storage.deleted') ?: [];
     $this->assertFalse(isset($deleted_storages[$field_storage->uuid()]), 'Telephone field has been completed removed from the system.');
     $this->assertTrue(isset($deleted_storages[$unrelated_field_storage->uuid()]), 'Unrelated field not purged by configuration synchronization.');
diff --git a/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php b/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
index 52eb4e4..b7acda8 100644
--- a/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
@@ -42,7 +42,7 @@ public function testCreate() {
     $field_storage->save();
 
     $field_storage = FieldStorageConfig::load($field_storage->id());
-    $this->assertTrue($field_storage->getSetting('storage_setting_from_config_data'));
+    $this->assertEquals('TRUE', $field_storage->getSetting('storage_setting_from_config_data'));
     $this->assertNull($field_storage->getSetting('config_data_from_storage_setting'));
 
     $mem = field_test_memorize();
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
index 6e8e040..bbf6d5f 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
@@ -64,7 +64,7 @@ public function testWidgetSettings() {
     $component = $form_display->getComponent('field_test_link');
     $this->assertIdentical('link_default', $component['type']);
     $this->assertIdentical(7, $component['weight']);
-    $this->assertFalse(array_filter($component['settings']));
+    $this->assertEmpty(array_filter($component['settings']));
 
     // File field.
     $component = $form_display->getComponent('field_test_filefield');
diff --git a/core/modules/field/tests/src/Kernel/String/UuidFormatterTest.php b/core/modules/field/tests/src/Kernel/String/UuidFormatterTest.php
index 0eeb778..b1415a3 100644
--- a/core/modules/field/tests/src/Kernel/String/UuidFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/String/UuidFormatterTest.php
@@ -43,7 +43,7 @@ public function testUuidStringFormatter() {
     // Verify default render.
     $render_array = $uuid_field->view([]);
     $this->assertIdentical($render_array[0]['#context']['value'], $entity->uuid(), 'The rendered UUID matches the entity UUID.');
-    $this->assertTrue(strpos($this->render($render_array), $entity->uuid()), 'The rendered UUID found.');
+    $this->assertContains($entity->uuid(), $this->render($render_array), 'The rendered UUID found.');
 
     // Verify customized render.
     $render_array = $uuid_field->view(['settings' => ['link_to_entity' => TRUE]]);
@@ -51,8 +51,8 @@ public function testUuidStringFormatter() {
     $this->assertIdentical($render_array[0]['#title']['#context']['value'], $entity->uuid());
     $this->assertIdentical($render_array[0]['#url']->toString(), $entity->url());
     $rendered = $this->render($render_array);
-    $this->assertTrue(strpos($rendered, $entity->uuid()), 'The rendered UUID found.');
-    $this->assertTrue(strpos($rendered, $entity->url()), 'The rendered entity URL found.');
+    $this->assertContains($entity->uuid(), $rendered, 'The rendered UUID found.');
+    $this->assertContains($entity->url(), $rendered, 'The rendered entity URL found.');
   }
 
 }
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
index 4a0e533..c4369f2 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
@@ -384,18 +384,18 @@ public function testDeleteField() {
 
     // Check the component exists.
     $display = entity_get_display('entity_test', 'entity_test', 'default');
-    $this->assertTrue($display->getComponent($field_name));
+    $this->assertNotEmpty($display->getComponent($field_name));
     $display = entity_get_display('entity_test', 'entity_test', 'teaser');
-    $this->assertTrue($display->getComponent($field_name));
+    $this->assertNotEmpty($display->getComponent($field_name));
 
     // Delete the field.
     $field->delete();
 
     // Check that the component has been removed from the entity displays.
     $display = entity_get_display('entity_test', 'entity_test', 'default');
-    $this->assertFalse($display->getComponent($field_name));
+    $this->assertNull($display->getComponent($field_name));
     $display = entity_get_display('entity_test', 'entity_test', 'teaser');
-    $this->assertFalse($display->getComponent($field_name));
+    $this->assertNull($display->getComponent($field_name));
   }
 
   /**
@@ -437,7 +437,7 @@ public function testOnDependencyRemoval() {
     // Removing the text module should remove the field from the view display.
     \Drupal::service('config.manager')->uninstall('module', 'text');
     $display = entity_get_display('entity_test', 'entity_test', 'default');
-    $this->assertFalse($display->getComponent($field_name));
+    $this->assertNull($display->getComponent($field_name));
   }
 
   /**
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
index 09d2a20..2e9fc9b 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
@@ -209,18 +209,18 @@ public function testDeleteField() {
 
     // Check the component exists.
     $display = entity_get_form_display('entity_test', 'entity_test', 'default');
-    $this->assertTrue($display->getComponent($field_name));
+    $this->assertNotEmpty($display->getComponent($field_name));
     $display = entity_get_form_display('entity_test', 'entity_test', 'compact');
-    $this->assertTrue($display->getComponent($field_name));
+    $this->assertNotEmpty($display->getComponent($field_name));
 
     // Delete the field.
     $field->delete();
 
     // Check that the component has been removed from the entity displays.
     $display = entity_get_form_display('entity_test', 'entity_test', 'default');
-    $this->assertFalse($display->getComponent($field_name));
+    $this->assertNull($display->getComponent($field_name));
     $display = entity_get_form_display('entity_test', 'entity_test', 'compact');
-    $this->assertFalse($display->getComponent($field_name));
+    $this->assertNull($display->getComponent($field_name));
   }
 
   /**
@@ -262,7 +262,7 @@ public function testOnDependencyRemoval() {
     // Removing the text module should remove the field from the form display.
     \Drupal::service('config.manager')->uninstall('module', 'text');
     $display = entity_get_form_display('entity_test', 'entity_test', 'default');
-    $this->assertFalse($display->getComponent($field_name));
+    $this->assertNull($display->getComponent($field_name));
   }
 
 }
diff --git a/core/modules/file/tests/src/Kernel/CopyTest.php b/core/modules/file/tests/src/Kernel/CopyTest.php
index 3193cb6..9f5c1fe 100644
--- a/core/modules/file/tests/src/Kernel/CopyTest.php
+++ b/core/modules/file/tests/src/Kernel/CopyTest.php
@@ -23,7 +23,7 @@ public function testNormal() {
     $result = file_copy(clone $source, $desired_uri, FILE_EXISTS_ERROR);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, 'File copied successfully.');
+    $this->assertNotFalse($result, 'File copied successfully.');
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of file were copied correctly.');
 
     // Check that the correct hooks were called.
@@ -54,7 +54,7 @@ public function testExistingRename() {
     $result = file_copy(clone $source, $target->getFileUri(), FILE_EXISTS_RENAME);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, 'File copied successfully.');
+    $this->assertNotFalse($result, 'File copied successfully.');
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of file were copied correctly.');
     $this->assertNotEqual($result->getFileUri(), $source->getFileUri(), 'Returned file path has changed from the original.');
 
@@ -94,7 +94,7 @@ public function testExistingReplace() {
     $result = file_copy(clone $source, $target->getFileUri(), FILE_EXISTS_REPLACE);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, 'File copied successfully.');
+    $this->assertNotFalse($result, 'File copied successfully.');
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of file were overwritten.');
     $this->assertDifferentFile($source, $result);
 
diff --git a/core/modules/file/tests/src/Kernel/DeleteTest.php b/core/modules/file/tests/src/Kernel/DeleteTest.php
index de5a5bc..ff96afc 100644
--- a/core/modules/file/tests/src/Kernel/DeleteTest.php
+++ b/core/modules/file/tests/src/Kernel/DeleteTest.php
@@ -21,7 +21,7 @@ public function testUnused() {
     $file->delete();
     $this->assertFileHooksCalled(['delete']);
     $this->assertFalse(file_exists($file->getFileUri()), 'Test file has actually been deleted.');
-    $this->assertFalse(File::load($file->id()), 'File was removed from the database.');
+    $this->assertNull(File::load($file->id()), 'File was removed from the database.');
   }
 
   /**
@@ -42,7 +42,7 @@ public function testInUse() {
     $usage = $file_usage->listUsage($file);
     $this->assertEqual($usage['testing']['test'], [1 => 1], 'Test file is still in use.');
     $this->assertTrue(file_exists($file->getFileUri()), 'File still exists on the disk.');
-    $this->assertTrue(File::load($file->id()), 'File still exists in the database.');
+    $this->assertNotEmpty(File::load($file->id()), 'File still exists in the database.');
 
     // Clear out the call to hook_file_load().
     file_test_reset();
@@ -53,7 +53,7 @@ public function testInUse() {
     $this->assertTrue(empty($usage), 'File usage data was removed.');
     $this->assertTrue(file_exists($file->getFileUri()), 'File still exists on the disk.');
     $file = File::load($file->id());
-    $this->assertTrue($file, 'File still exists in the database.');
+    $this->assertNotEmpty($file, 'File still exists in the database.');
     $this->assertTrue($file->isTemporary(), 'File is temporary.');
     file_test_reset();
 
@@ -71,7 +71,7 @@ public function testInUse() {
     // file_cron() loads
     $this->assertFileHooksCalled(['delete']);
     $this->assertFalse(file_exists($file->getFileUri()), 'File has been deleted after its last usage was removed.');
-    $this->assertFalse(File::load($file->id()), 'File was removed from the database.');
+    $this->assertNull(File::load($file->id()), 'File was removed from the database.');
   }
 
 }
diff --git a/core/modules/file/tests/src/Kernel/LoadTest.php b/core/modules/file/tests/src/Kernel/LoadTest.php
index 9d71539..86eee5f 100644
--- a/core/modules/file/tests/src/Kernel/LoadTest.php
+++ b/core/modules/file/tests/src/Kernel/LoadTest.php
@@ -14,7 +14,7 @@ class LoadTest extends FileManagedUnitTestBase {
    * Try to load a non-existent file by fid.
    */
   public function testLoadMissingFid() {
-    $this->assertFalse(File::load(-1), 'Try to load an invalid fid fails.');
+    $this->assertNull(File::load(-1), 'Try to load an invalid fid fails.');
     $this->assertFileHooksCalled([]);
   }
 
diff --git a/core/modules/file/tests/src/Kernel/MoveTest.php b/core/modules/file/tests/src/Kernel/MoveTest.php
index 3183ecf..678d3fa 100644
--- a/core/modules/file/tests/src/Kernel/MoveTest.php
+++ b/core/modules/file/tests/src/Kernel/MoveTest.php
@@ -23,7 +23,7 @@ public function testNormal() {
     $result = file_move(clone $source, $desired_filepath, FILE_EXISTS_ERROR);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, 'File moved successfully.');
+    $this->assertNotFalse($result, 'File moved successfully.');
     $this->assertFalse(file_exists($source->getFileUri()));
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of file correctly written.');
 
@@ -36,7 +36,7 @@ public function testNormal() {
     // Reload the file from the database and check that the changes were
     // actually saved.
     $loaded_file = File::load($result->id());
-    $this->assertTrue($loaded_file, 'File can be loaded from the database.');
+    $this->assertNotEmpty($loaded_file, 'File can be loaded from the database.');
     $this->assertFileUnchanged($result, $loaded_file);
   }
 
@@ -55,7 +55,7 @@ public function testExistingRename() {
     $result = file_move(clone $source, $target->getFileUri(), FILE_EXISTS_RENAME);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, 'File moved successfully.');
+    $this->assertNotFalse($result, 'File moved successfully.');
     $this->assertFalse(file_exists($source->getFileUri()));
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of file correctly written.');
 
@@ -92,7 +92,7 @@ public function testExistingReplace() {
     // Look at the results.
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of file were overwritten.');
     $this->assertFalse(file_exists($source->getFileUri()));
-    $this->assertTrue($result, 'File moved successfully.');
+    $this->assertNotEmpty($result, 'File moved successfully.');
 
     // Check that the correct hooks were called.
     $this->assertFileHooksCalled(['move', 'update', 'delete', 'load']);
diff --git a/core/modules/file/tests/src/Kernel/SaveDataTest.php b/core/modules/file/tests/src/Kernel/SaveDataTest.php
index 747c7b1..533867d 100644
--- a/core/modules/file/tests/src/Kernel/SaveDataTest.php
+++ b/core/modules/file/tests/src/Kernel/SaveDataTest.php
@@ -17,7 +17,7 @@ public function testWithoutFilename() {
     $contents = $this->randomMachineName(8);
 
     $result = file_save_data($contents);
-    $this->assertTrue($result, 'Unnamed file saved correctly.');
+    $this->assertNotFalse($result, 'Unnamed file saved correctly.');
 
     $this->assertEqual(file_default_scheme(), file_uri_scheme($result->getFileUri()), "File was placed in Drupal's files directory.");
     $this->assertEqual($result->getFilename(), drupal_basename($result->getFileUri()), "Filename was set to the file's basename.");
@@ -42,7 +42,7 @@ public function testWithFilename() {
     $filename = 'Текстовый файл.txt';
 
     $result = file_save_data($contents, 'public://' . $filename);
-    $this->assertTrue($result, 'Unnamed file saved correctly.');
+    $this->assertNotFalse($result, 'Unnamed file saved correctly.');
 
     $this->assertEqual('public', file_uri_scheme($result->getFileUri()), "File was placed in Drupal's files directory.");
     $this->assertEqual($filename, drupal_basename($result->getFileUri()), 'File was named correctly.');
@@ -66,7 +66,7 @@ public function testExistingRename() {
     $contents = $this->randomMachineName(8);
 
     $result = file_save_data($contents, $existing->getFileUri(), FILE_EXISTS_RENAME);
-    $this->assertTrue($result, 'File saved successfully.');
+    $this->assertNotFalse($result, 'File saved successfully.');
 
     $this->assertEqual('public', file_uri_scheme($result->getFileUri()), "File was placed in Drupal's files directory.");
     $this->assertEqual($result->getFilename(), $existing->getFilename(), 'Filename was set to the basename of the source, rather than that of the renamed file.');
@@ -94,7 +94,7 @@ public function testExistingReplace() {
     $contents = $this->randomMachineName(8);
 
     $result = file_save_data($contents, $existing->getFileUri(), FILE_EXISTS_REPLACE);
-    $this->assertTrue($result, 'File saved successfully.');
+    $this->assertNotFalse($result, 'File saved successfully.');
 
     $this->assertEqual('public', file_uri_scheme($result->getFileUri()), "File was placed in Drupal's files directory.");
     $this->assertEqual($result->getFilename(), $existing->getFilename(), 'Filename was set to the basename of the existing file, rather than preserving the original name.');
diff --git a/core/modules/filter/tests/src/Functional/FilterAdminTest.php b/core/modules/filter/tests/src/Functional/FilterAdminTest.php
index a6e4293..0eaf668 100644
--- a/core/modules/filter/tests/src/Functional/FilterAdminTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterAdminTest.php
@@ -295,7 +295,7 @@ public function testFilterAdmin() {
     $this->assertNotEmpty($view_link, 'The message area contains a link to a node');
 
     $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
-    $this->assertTrue($node, 'Node found in database.');
+    $this->assertNotEmpty($node, 'Node found in database.');
 
     $this->drupalGet('node/' . $node->id());
     $this->assertRaw($body . $extra_text, 'Filter removed invalid tag.');
diff --git a/core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php b/core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php
index e16bdda..49fb44f 100644
--- a/core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php
@@ -39,7 +39,7 @@ public function testInstallation() {
     $this->assertEqual($format->get('weight'), 2);
 
     // Verify that format default property values have been added/injected.
-    $this->assertTrue($format->uuid());
+    $this->assertNotEmpty($format->uuid());
 
     // Verify that the loaded format does not contain any roles.
     $this->assertEqual($format->get('roles'), NULL);
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
index 87ad05b..667a24a 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
@@ -204,7 +204,7 @@ public function testNodeTypeDelete() {
 
     // Check the language default configuration for articles is present.
     $configuration = \Drupal::entityManager()->getStorage('language_content_settings')->load('node.article');
-    $this->assertTrue($configuration, 'The language configuration is present.');
+    $this->assertNotEmpty($configuration, 'The language configuration is present.');
 
     // Delete 'article' bundle.
     $this->drupalPostForm('admin/structure/types/manage/article/delete', [], t('Delete'));
@@ -212,7 +212,7 @@ public function testNodeTypeDelete() {
     // Check that the language configuration has been deleted.
     \Drupal::entityManager()->getStorage('language_content_settings')->resetCache();
     $configuration = \Drupal::entityManager()->getStorage('language_content_settings')->load('node.article');
-    $this->assertFalse($configuration, 'The language configuration was deleted after bundle was deleted.');
+    $this->assertEmpty($configuration, 'The language configuration was deleted after bundle was deleted.');
   }
 
   /**
diff --git a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
index 34f0c81..acf465c 100644
--- a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
@@ -519,7 +519,7 @@ public function testDisableLanguageSwitcher() {
 
     // Check if the language switcher block has been created.
     $block = Block::load($block_id);
-    $this->assertTrue($block, 'Language switcher block was created.');
+    $this->assertNotEmpty($block, 'Language switcher block was created.');
 
     // Make sure language_content is not configurable.
     $edit = [
@@ -530,7 +530,7 @@ public function testDisableLanguageSwitcher() {
 
     // Check if the language switcher block has been removed.
     $block = Block::load($block_id);
-    $this->assertFalse($block, 'Language switcher block was removed.');
+    $this->assertNull($block, 'Language switcher block was removed.');
   }
 
 }
diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
index 4d1b9df..888e21f 100644
--- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
@@ -64,7 +64,7 @@ public function testConfigTranslation() {
     // Check that the maintenance message exists and create translation for it.
     $source = '@site is currently under maintenance. We should be back shortly. Thank you for your patience.';
     $string = $this->storage->findString(['source' => $source, 'context' => '', 'type' => 'configuration']);
-    $this->assertTrue($string, 'Configuration strings have been created upon installation.');
+    $this->assertNotEmpty($string, 'Configuration strings have been created upon installation.');
 
     // Translate using the UI so configuration is refreshed.
     $message = $this->randomMachineName(20);
@@ -89,7 +89,7 @@ public function testConfigTranslation() {
 
     // Check default medium date format exists and create a translation for it.
     $string = $this->storage->findString(['source' => 'D, m/d/Y - H:i', 'context' => 'PHP date format', 'type' => 'configuration']);
-    $this->assertTrue($string, 'Configuration date formats have been created upon installation.');
+    $this->assertNotEmpty($string, 'Configuration date formats have been created upon installation.');
 
     // Translate using the UI so configuration is refreshed.
     $search = [
@@ -116,14 +116,14 @@ public function testConfigTranslation() {
 
     // Assert strings from image module config are not available.
     $string = $this->storage->findString(['source' => 'Medium (220×220)', 'context' => '', 'type' => 'configuration']);
-    $this->assertFalse($string, 'Configuration strings have been created upon installation.');
+    $this->assertNull($string, 'Configuration strings have been created upon installation.');
 
     // Enable the image module.
     $this->drupalPostForm('admin/modules', ['modules[image][enable]' => "1"], t('Install'));
     $this->rebuildContainer();
 
     $string = $this->storage->findString(['source' => 'Medium (220×220)', 'context' => '', 'type' => 'configuration']);
-    $this->assertTrue($string, 'Configuration strings have been created upon installation.');
+    $this->assertNotEmpty($string, 'Configuration strings have been created upon installation.');
     $locations = $string->getLocations();
     $this->assertTrue(isset($locations['configuration']) && isset($locations['configuration']['image.style.medium']), 'Configuration string has been created with the right location');
 
@@ -132,7 +132,7 @@ public function testConfigTranslation() {
     $this->assertEqual(count($translations), 1);
     $translation = reset($translations);
     $this->assertEqual($translation->source, $string->source);
-    $this->assertTrue(empty($translation->translation));
+    $this->assertEmpty($translation->translation);
 
     // Translate using the UI so configuration is refreshed.
     $image_style_label = $this->randomMachineName(20);
@@ -223,22 +223,22 @@ protected function assertNodeConfig($required, $optional) {
     $string = $this->storage->findString(['source' => 'Make content sticky', 'context' => '', 'type' => 'configuration']);
     if ($required) {
       $this->assertFalse($this->config('system.action.node_make_sticky_action')->isNew());
-      $this->assertTrue($string, 'Node action text can be found with node module.');
+      $this->assertNotEmpty($string, 'Node action text can be found with node module.');
     }
     else {
       $this->assertTrue($this->config('system.action.node_make_sticky_action')->isNew());
-      $this->assertFalse($string, 'Node action text can not be found without node module.');
+      $this->assertNull($string, 'Node action text can not be found without node module.');
     }
 
     // Check the optional default configuration in node module.
     $string = $this->storage->findString(['source' => 'No front page content has been created yet.', 'context' => '', 'type' => 'configuration']);
     if ($optional) {
       $this->assertFalse($this->config('views.view.frontpage')->isNew());
-      $this->assertTrue($string, 'Node view text can be found with node and views modules.');
+      $this->assertNotEmpty($string, 'Node view text can be found with node and views modules.');
     }
     else {
       $this->assertTrue($this->config('views.view.frontpage')->isNew());
-      $this->assertFalse($string, 'Node view text can not be found without node and/or views modules.');
+      $this->assertNull($string, 'Node view text can not be found without node and/or views modules.');
     }
   }
 
diff --git a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
index e3a2c26..83d3354 100644
--- a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
@@ -305,7 +305,7 @@ public function testConfigPoFile() {
     $locale_storage = $this->container->get('locale.storage');
     foreach ($config_strings as $config_string) {
       $string = $locale_storage->findString(['source' => $config_string[0], 'context' => '', 'type' => 'configuration']);
-      $this->assertTrue($string, 'Configuration strings have been created upon installation.');
+      $this->assertNotEmpty($string, 'Configuration strings have been created upon installation.');
     }
 
     // Import a .po file to translate.
diff --git a/core/modules/locale/tests/src/Functional/LocaleStringTest.php b/core/modules/locale/tests/src/Functional/LocaleStringTest.php
index 601b738..78f2ae9 100644
--- a/core/modules/locale/tests/src/Functional/LocaleStringTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleStringTest.php
@@ -46,7 +46,7 @@ public function testStringCRUDAPI() {
     // Create source string.
     $source = $this->buildSourceString();
     $source->save();
-    $this->assertTrue($source->lid, format_string('Successfully created string %string', ['%string' => $source->source]));
+    $this->assertNotEmpty($source->lid, format_string('Successfully created string %string', ['%string' => $source->source]));
 
     // Load strings by lid and source.
     $string1 = $this->storage->findString(['lid' => $source->lid]);
@@ -54,7 +54,7 @@ public function testStringCRUDAPI() {
     $string2 = $this->storage->findString(['source' => $source->source, 'context' => $source->context]);
     $this->assertEqual($source, $string2, 'Successfully retrieved string by source and context.');
     $string3 = $this->storage->findString(['source' => $source->source, 'context' => '']);
-    $this->assertFalse($string3, 'Cannot retrieve string with wrong context.');
+    $this->assertNull($string3, 'Cannot retrieve string with wrong context.');
 
     // Check version handling and updating.
     $this->assertEqual($source->version, 'none', 'String originally created without version.');
@@ -89,9 +89,9 @@ public function testStringCRUDAPI() {
 
     $source->delete();
     $string = $this->storage->findString(['lid' => $lid]);
-    $this->assertFalse($string, 'Successfully deleted source string.');
+    $this->assertNull($string, 'Successfully deleted source string.');
     $deleted = $search = $this->storage->getTranslations(['lid' => $lid]);
-    $this->assertFalse($deleted, 'Successfully deleted all translation strings.');
+    $this->assertEmpty($deleted, 'Successfully deleted all translation strings.');
 
     // Tests that locations of different types and arbitrary lengths can be
     // added to a source string. Too long locations will be cut off.
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php
index f4c59b2..57a7c73 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php
@@ -88,7 +88,7 @@ protected function addLanguage($langcode) {
     $edit = ['predefined_langcode' => $langcode];
     $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
     $this->container->get('language_manager')->reset();
-    $this->assertTrue(\Drupal::languageManager()->getLanguage($langcode), SafeMarkup::format('Language %langcode added.', ['%langcode' => $langcode]));
+    $this->assertNotEmpty(\Drupal::languageManager()->getLanguage($langcode), SafeMarkup::format('Language %langcode added.', ['%langcode' => $langcode]));
   }
 
   /**
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
index c6c69c2..590c1e2 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
@@ -114,7 +114,7 @@ public function testInterface() {
     $this->assertText(t('Updates for: @project', ['@project' => t('Drupal core')]), 'Translations found');
     $this->assertText(SafeMarkup::format('@module (@date)', ['@module' => t('Drupal core'), '@date' => format_date(REQUEST_TIME, 'html_date')]), 'Core translation update');
     $update_button = $this->xpath('//input[@type="submit"][@value="' . t('Update translations') . '"]');
-    $this->assertTrue($update_button, 'Update translations button');
+    $this->assertNotEmpty($update_button, 'Update translations button');
   }
 
 }
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
index 907e572..e508d18 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
@@ -364,7 +364,7 @@ public function testEnableLanguage() {
 
     // Check if the language data is added to the database.
     $result = db_query("SELECT project FROM {locale_file} WHERE langcode='nl'")->fetchField();
-    $this->assertTrue($result, 'Files added to file history');
+    $this->assertNotEmpty($result, 'Files added to file history');
 
     // Remove a language.
     $this->drupalPostForm('admin/config/regional/language/delete/nl', [], t('Delete'));
diff --git a/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php b/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
index 74ac67c..d8fa3d4 100644
--- a/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
+++ b/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
@@ -134,7 +134,7 @@ public function testMediaWithOnlyOneMediaType() {
     $assert_session->pageTextContains('This action cannot be undone');
     $page->pressButton('Delete');
     $media_id = \Drupal::entityQuery('media')->execute();
-    $this->assertFalse($media_id);
+    $this->assertEmpty($media_id);
   }
 
   /**
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
index 94e89c6..618c2bd 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
@@ -41,7 +41,7 @@ public function testMediaWizard() {
     // Check for the default filters.
     $this->assertEquals($view->filter['status']->table, 'media_field_data');
     $this->assertEquals($view->filter['status']->field, 'status');
-    $this->assertTrue($view->filter['status']->value);
+    $this->assertEquals($view->filter['status']->value, '1');
     // Check for the default fields.
     $this->assertEquals($view->field['name']->table, 'media_field_data');
     $this->assertEquals($view->field['name']->field, 'name');
@@ -75,7 +75,7 @@ public function testMediaRevisionWizard() {
     // Check for the default filters.
     $this->assertEquals($view->filter['status']->table, 'media_field_revision');
     $this->assertEquals($view->filter['status']->field, 'status');
-    $this->assertTrue($view->filter['status']->value);
+    $this->assertEquals($view->filter['status']->value, '1');
 
     // Check for the default fields.
     $this->assertEquals($view->field['name']->table, 'media_field_revision');
diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
index 464b86c..7351854 100644
--- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
+++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
@@ -76,7 +76,7 @@ public function testMenuLinkContentFormLinkToAnyPage() {
   public function testMenuLinkContentForm() {
     $this->drupalGet('admin/structure/menu/manage/admin/add');
     $element = $this->xpath('//select[@id = :id]/option[@selected]', [':id' => 'edit-menu-parent']);
-    $this->assertTrue($element, 'A default menu parent was found.');
+    $this->assertNotEmpty($element, 'A default menu parent was found.');
     $this->assertEqual('admin:', $element[0]->getValue(), '<Administration> menu is the parent.');
 
     $this->drupalPostForm(
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php
index a5e8dd0..79c9d01 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php
@@ -113,7 +113,7 @@ public function testMenuLinks() {
     $tree = $menu_link_tree_service->load(static::MENU_NAME, $parameters);
     $found = FALSE;
     foreach ($tree as $menu_link_tree_element) {
-      $this->assertTrue($menu_link_tree_element->link->getUrlObject()->toString());
+      $this->assertNotEmpty($menu_link_tree_element->link->getUrlObject()->toString());
       if ($menu_link_tree_element->link->getTitle() == 'custom link test') {
         $found = TRUE;
         break;
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php
index a0320f4..860d7eb 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php
@@ -27,7 +27,7 @@ public function testMenuUninstall() {
 
     \Drupal::entityManager()->getStorage('menu')->resetCache(['admin']);
 
-    $this->assertTrue(Menu::load('admin'), 'The \'admin\' menu still exists after uninstalling Menu UI module.');
+    $this->assertNotEmpty(Menu::load('admin'), 'The \'admin\' menu still exists after uninstalling Menu UI module.');
   }
 
 }
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
index 0ebc719..a287a9e 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
@@ -64,7 +64,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);
@@ -109,7 +109,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.
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php b/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php
index a639959..fe7ab2d 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php
@@ -71,7 +71,7 @@ public function testConfigEntityRollback() {
     foreach ($vocabulary_data_rows as $row) {
       /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */
       $vocabulary = Vocabulary::load($row['id']);
-      $this->assertTrue($vocabulary);
+      $this->assertNotEmpty($vocabulary);
       $map_row = $vocabulary_id_map->getRowBySource(['id' => $row['id']]);
       $this->assertNotNull($map_row['destid1']);
     }
@@ -159,7 +159,7 @@ public function testConfigEntityRollback() {
     foreach ($vocabulary_data_rows as $row) {
       /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */
       $vocabulary = Vocabulary::load($row['id']);
-      $this->assertTrue($vocabulary);
+      $this->assertNotEmpty($vocabulary);
       $map_row = $vocabulary_id_map->getRowBySource(['id' => $row['id']]);
       $this->assertNotNull($map_row['destid1']);
     }
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php b/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php
index 427f5bc..bc96f1a 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php
@@ -71,7 +71,7 @@ public function testRollback() {
     foreach ($vocabulary_data_rows as $row) {
       /** @var Vocabulary $vocabulary */
       $vocabulary = Vocabulary::load($row['id']);
-      $this->assertTrue($vocabulary);
+      $this->assertNotEmpty($vocabulary);
       $map_row = $vocabulary_id_map->getRowBySource(['id' => $row['id']]);
       $this->assertNotNull($map_row['destid1']);
     }
@@ -124,7 +124,7 @@ public function testRollback() {
     foreach ($term_data_rows as $row) {
       /** @var Term $term */
       $term = Term::load($row['id']);
-      $this->assertTrue($term);
+      $this->assertNotEmpty($term);
       $map_row = $term_id_map->getRowBySource(['id' => $row['id']]);
       $this->assertNotNull($map_row['destid1']);
     }
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php
index 8e16699..821e5e8 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php
@@ -44,16 +44,16 @@ public function testProvidersExist() {
       $destination_module = $migration->getDestinationPlugin()->getDestinationModule();
       $migration_id = $migration->getPluginId();
       if ($migration_id == 'migration_provider_test') {
-        $this->assertFalse($source_module, new FormattableMarkup('Source module not found for @migration_id.', ['@migration_id' => $migration_id]));
-        $this->assertFalse($destination_module, new FormattableMarkup('Destination module not found for @migration_id.', ['@migration_id' => $migration_id]));
+        $this->assertNull($source_module, new FormattableMarkup('Source module not found for @migration_id.', ['@migration_id' => $migration_id]));
+        $this->assertNull($destination_module, new FormattableMarkup('Destination module not found for @migration_id.', ['@migration_id' => $migration_id]));
       }
       elseif ($migration_id == 'migration_provider_no_annotation') {
-        $this->assertFalse($source_module, new FormattableMarkup('Source module not found for @migration_id.', ['@migration_id' => $migration_id]));
-        $this->assertTrue($destination_module, new FormattableMarkup('Destination module found for @migration_id.', ['@migration_id' => $migration_id]));
+        $this->assertNull($source_module, new FormattableMarkup('Source module not found for @migration_id.', ['@migration_id' => $migration_id]));
+        $this->assertNotEmpty($destination_module, new FormattableMarkup('Destination module found for @migration_id.', ['@migration_id' => $migration_id]));
       }
       else {
-        $this->assertTrue($source_module, new FormattableMarkup('Source module found for @migration_id.', ['@migration_id' => $migration_id]));
-        $this->assertTrue($destination_module, new FormattableMarkup('Destination module found for @migration_id.', ['@migration_id' => $migration_id]));
+        $this->assertNotEmpty($source_module, new FormattableMarkup('Source module found for @migration_id.', ['@migration_id' => $migration_id]));
+        $this->assertNotEmpty($destination_module, new FormattableMarkup('Destination module found for @migration_id.', ['@migration_id' => $migration_id]));
       }
       // Destination module can't be migrate or migrate_drupal or migrate_drupal_ui
       $invalid_destinations = ['migrate', 'migrate_drupal', 'migrate_drupal_ui'];
diff --git a/core/modules/migrate_drupal/src/Tests/StubTestTrait.php b/core/modules/migrate_drupal/src/Tests/StubTestTrait.php
index 3bf0028..adf7008 100644
--- a/core/modules/migrate_drupal/src/Tests/StubTestTrait.php
+++ b/core/modules/migrate_drupal/src/Tests/StubTestTrait.php
@@ -18,7 +18,7 @@
    */
   protected function performStubTest($entity_type_id) {
     $entity_id = $this->createStub($entity_type_id);
-    $this->assertTrue($entity_id, 'Stub successfully created');
+    $this->assertNotEmpty($entity_id, 'Stub successfully created');
     if ($entity_id) {
       $violations = $this->validateStub($entity_type_id, $entity_id);
       if (!$this->assertIdentical(count($violations), 0, 'Stub is a valid entity')) {
diff --git a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
index 5b99ccf..7f0fe23 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
@@ -124,8 +124,8 @@ public function testNodeAccessBasic() {
     }
     $this->publicTid = db_query('SELECT tid FROM {taxonomy_term_field_data} WHERE name = :name AND default_langcode = 1', [':name' => 'public'])->fetchField();
     $this->privateTid = db_query('SELECT tid FROM {taxonomy_term_field_data} WHERE name = :name AND default_langcode = 1', [':name' => 'private'])->fetchField();
-    $this->assertTrue($this->publicTid, 'Public tid was found');
-    $this->assertTrue($this->privateTid, 'Private tid was found');
+    $this->assertNotEmpty($this->publicTid, 'Public tid was found');
+    $this->assertNotEmpty($this->privateTid, 'Private tid was found');
     foreach ($simple_users as $this->webUser) {
       $this->drupalLogin($this->webUser);
       // Check own nodes to see that all are readable.
@@ -198,7 +198,7 @@ protected function assertTaxonomyPage($is_admin) {
       $this->nidsVisible = [];
       foreach ($this->xpath("//a[text()='Read more']") as $link) {
         // See also testTranslationRendering() in NodeTranslationUITest.
-        $this->assertTrue(preg_match('|node/(\d+)$|', $link->getAttribute('href'), $matches), 'Read more points to a node');
+        $this->assertNotEmpty(preg_match('|node/(\d+)$|', $link->getAttribute('href'), $matches), 'Read more points to a node');
         $this->nidsVisible[$matches[1]] = TRUE;
       }
       foreach ($this->nodesByUser as $uid => $data) {
diff --git a/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php b/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
index ad6cc54..4fc7358 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
@@ -71,12 +71,12 @@ public function testCommentPager() {
   public function testForumPager() {
     // Look up the forums vocabulary ID.
     $vid = $this->config('forum.settings')->get('vocabulary');
-    $this->assertTrue($vid, 'Forum navigation vocabulary ID is set.');
+    $this->assertNotEmpty($vid, 'Forum navigation vocabulary ID is set.');
 
     // Look up the general discussion term.
     $tree = \Drupal::entityManager()->getStorage('taxonomy_term')->loadTree($vid, 0, 1);
     $tid = reset($tree)->tid;
-    $this->assertTrue($tid, 'General discussion term is found in the forum vocabulary.');
+    $this->assertNotEmpty($tid, 'General discussion term is found in the forum vocabulary.');
 
     // Create 30 nodes.
     for ($i = 0; $i < 30; $i++) {
diff --git a/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php b/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
index 9ea75cc..31c224f 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
@@ -60,7 +60,7 @@ public function testNodeAccessRebuildNodeGrants() {
     $grant_storage = \Drupal::service('node.grant_storage');
     // Default realm access and node records are present.
     foreach ($nodes as $node) {
-      $this->assertTrue($node->private->value);
+      $this->assertNotEmpty($node->private->value);
       $this->assertTrue($grant_storage->access($node, 'view', $this->webUser)->isAllowed(), 'Prior to rebuilding node access the grant storage returns allowed for the node author.');
       $this->assertTrue($grant_storage->access($node, 'view', $this->adminUser)->isAllowed(), 'Prior to rebuilding node access the grant storage returns allowed for the admin user.');
     }
@@ -82,7 +82,7 @@ public function testNodeAccessRebuildNodeGrants() {
       $this->assertTrue($grant_storage->access($node, 'view', $this->webUser)->isAllowed(), 'After rebuilding node access the grant storage returns allowed for the node author.');
       $this->assertFalse($grant_storage->access($node, 'view', $this->adminUser)->isForbidden(), 'After rebuilding node access the grant storage returns forbidden for the admin user.');
     }
-    $this->assertFalse(\Drupal::service('node.grant_storage')->checkAll($this->webUser), 'There is no all realm access record');
+    $this->assertEmpty(\Drupal::service('node.grant_storage')->checkAll($this->webUser), 'There is no all realm access record');
 
     // Test an anonymous node access rebuild from code.
     $this->drupalLogout();
@@ -91,7 +91,7 @@ public function testNodeAccessRebuildNodeGrants() {
       $this->assertTrue($grant_storage->access($node, 'view', $this->webUser)->isAllowed(), 'After rebuilding node access the grant storage returns allowed for the node author.');
       $this->assertFalse($grant_storage->access($node, 'view', $this->adminUser)->isForbidden(), 'After rebuilding node access the grant storage returns forbidden for the admin user.');
     }
-    $this->assertFalse(\Drupal::service('node.grant_storage')->checkAll($this->webUser), 'There is no all realm access record');
+    $this->assertEmpty(\Drupal::service('node.grant_storage')->checkAll($this->webUser), 'There is no all realm access record');
   }
 
   /**
@@ -102,7 +102,7 @@ public function testNodeAccessRebuildNoAccessModules() {
     $this->assertEqual(1, \Drupal::service('node.grant_storage')->count(), 'There is an all realm access record');
 
     // No need to rebuild permissions.
-    $this->assertFalse(\Drupal::state()->get('node.node_access_needs_rebuild'), 'Node access permissions need to be rebuilt');
+    $this->assertNull(\Drupal::state()->get('node.node_access_needs_rebuild'), 'Node access permissions need to be rebuilt');
 
     // Rebuild permissions.
     $this->drupalGet('admin/reports/status');
diff --git a/core/modules/node/tests/src/Functional/NodeAccessRecordsTest.php b/core/modules/node/tests/src/Functional/NodeAccessRecordsTest.php
index 259ed83..b8e43ca 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessRecordsTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessRecordsTest.php
@@ -24,7 +24,7 @@ class NodeAccessRecordsTest extends NodeTestBase {
   public function testNodeAccessRecords() {
     // Create an article node.
     $node1 = $this->drupalCreateNode(['type' => 'article']);
-    $this->assertTrue(Node::load($node1->id()), 'Article node created.');
+    $this->assertNotEmpty(Node::load($node1->id()), 'Article node created.');
 
     // Check to see if grants added by node_test_node_access_records made it in.
     $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', [':nid' => $node1->id()])->fetchAll();
@@ -34,7 +34,7 @@ public function testNodeAccessRecords() {
 
     // Create an unpromoted "Basic page" node.
     $node2 = $this->drupalCreateNode(['type' => 'page', 'promote' => 0]);
-    $this->assertTrue(Node::load($node2->id()), 'Unpromoted basic page node created.');
+    $this->assertNotEmpty(Node::load($node2->id()), 'Unpromoted basic page node created.');
 
     // Check to see if grants added by node_test_node_access_records made it in.
     $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', [':nid' => $node2->id()])->fetchAll();
@@ -44,7 +44,7 @@ public function testNodeAccessRecords() {
 
     // Create an unpromoted, unpublished "Basic page" node.
     $node3 = $this->drupalCreateNode(['type' => 'page', 'promote' => 0, 'status' => 0]);
-    $this->assertTrue(Node::load($node3->id()), 'Unpromoted, unpublished basic page node created.');
+    $this->assertNotEmpty(Node::load($node3->id()), 'Unpromoted, unpublished basic page node created.');
 
     // Check to see if grants added by node_test_node_access_records made it in.
     $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', [':nid' => $node3->id()])->fetchAll();
@@ -54,7 +54,7 @@ public function testNodeAccessRecords() {
 
     // Create a promoted "Basic page" node.
     $node4 = $this->drupalCreateNode(['type' => 'page', 'promote' => 1]);
-    $this->assertTrue(Node::load($node4->id()), 'Promoted basic page node created.');
+    $this->assertNotEmpty(Node::load($node4->id()), 'Promoted basic page node created.');
 
     // Check to see if grant added by node_test_node_access_records was altered
     // by node_test_node_access_records_alter.
diff --git a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
index c2c7617..e48cb7d 100644
--- a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
@@ -78,7 +78,7 @@ public function testAssignOwnerNodeActionConfiguration() {
     $this->assertNoText($new_action_label, 'The label for the node_assign_owner_action action does not appear on the actions administration page after deleting.');
 
     $action = Action::load($action_id);
-    $this->assertFalse($action, 'The node_assign_owner_action action is not available after being deleted.');
+    $this->assertNull($action, 'The node_assign_owner_action action is not available after being deleted.');
   }
 
 }
diff --git a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
index c203c50..ea07653 100644
--- a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
+++ b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
@@ -96,7 +96,7 @@ public function testRecentNodeBlock() {
     $this->assertText($node3->label(), 'Node found in block.');
 
     // Check to make sure nodes are in the right order.
-    $this->assertTrue($this->xpath('//div[@id="block-test-block"]//div[@class="item-list"]/ul/li[1]/div/span/a[text() = "' . $node3->label() . '"]'), 'Nodes were ordered correctly in block.');
+    $this->assertNotEmpty($this->xpath('//div[@id="block-test-block"]//div[@class="item-list"]/ul/li[1]/div/span/a[text() = "' . $node3->label() . '"]'), 'Nodes were ordered correctly in block.');
 
     $this->drupalLogout();
     $this->drupalLogin($this->adminUser);
diff --git a/core/modules/node/tests/src/Functional/NodeCreationTest.php b/core/modules/node/tests/src/Functional/NodeCreationTest.php
index 4d24901..1b71830 100644
--- a/core/modules/node/tests/src/Functional/NodeCreationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeCreationTest.php
@@ -56,7 +56,7 @@ public function testNodeCreation() {
 
     // Check that the node exists in the database.
     $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
-    $this->assertTrue($node, 'Node found in database.');
+    $this->assertNotEmpty($node, 'Node found in database.');
 
     // Verify that pages do not show submitted information by default.
     $this->drupalGet('node/' . $node->id());
diff --git a/core/modules/node/tests/src/Functional/NodeEditFormTest.php b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
index c15ca70..6f0df27 100644
--- a/core/modules/node/tests/src/Functional/NodeEditFormTest.php
+++ b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
@@ -66,7 +66,7 @@ public function testNodeEdit() {
 
     // Check that the node exists in the database.
     $node = $this->drupalGetNodeByTitle($edit[$title_key]);
-    $this->assertTrue($node, 'Node found in database.');
+    $this->assertNotEmpty($node, 'Node found in database.');
 
     // Check that "edit" link points to correct page.
     $this->clickLink(t('Edit'));
diff --git a/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php b/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
index 771426d..a3a451e 100644
--- a/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
+++ b/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
@@ -71,7 +71,7 @@ public function testMultilingualNodeForm() {
 
     // Check that the node exists in the database.
     $node = $this->drupalGetNodeByTitle($edit[$title_key]);
-    $this->assertTrue($node, 'Node found in database.');
+    $this->assertNotEmpty($node, 'Node found in database.');
     $this->assertTrue($node->language()->getId() == $langcode && $node->body->value == $body_value, 'Field language correctly set.');
 
     // Change node language.
@@ -83,7 +83,7 @@ public function testMultilingualNodeForm() {
     ];
     $this->drupalPostForm(NULL, $edit, t('Save'));
     $node = $this->drupalGetNodeByTitle($edit[$title_key], TRUE);
-    $this->assertTrue($node, 'Node found in database.');
+    $this->assertNotEmpty($node, 'Node found in database.');
     $this->assertTrue($node->language()->getId() == $langcode && $node->body->value == $body_value, 'Field language correctly changed.');
 
     // Enable content language URL detection.
@@ -115,7 +115,7 @@ public function testMultilingualDisplaySettings() {
 
     // Check that the node exists in the database.
     $node = $this->drupalGetNodeByTitle($edit[$title_key]);
-    $this->assertTrue($node, 'Node found in database.');
+    $this->assertNotEmpty($node, 'Node found in database.');
 
     // Check if node body is showed.
     $this->drupalGet('node/' . $node->id());
diff --git a/core/modules/node/tests/src/Functional/NodeSaveTest.php b/core/modules/node/tests/src/Functional/NodeSaveTest.php
index ced9957..2a5b84b 100644
--- a/core/modules/node/tests/src/Functional/NodeSaveTest.php
+++ b/core/modules/node/tests/src/Functional/NodeSaveTest.php
@@ -67,10 +67,10 @@ public function testImport() {
     $node->save();
     // Test the import.
     $node_by_nid = Node::load($test_nid);
-    $this->assertTrue($node_by_nid, 'Node load by node ID.');
+    $this->assertNotEmpty($node_by_nid, 'Node load by node ID.');
 
     $node_by_title = $this->drupalGetNodeByTitle($title);
-    $this->assertTrue($node_by_title, 'Node load by node title.');
+    $this->assertNotEmpty($node_by_title, 'Node load by node title.');
   }
 
   /**
diff --git a/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php b/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
index 9c442fd..67f40b6 100644
--- a/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
@@ -97,7 +97,7 @@ public function testLanguageFieldVisibility() {
     ];
     $this->drupalPostForm('node/add/article', $edit, t('Save'));
     $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
-    $this->assertTrue($node, 'Node found in database.');
+    $this->assertNotEmpty($node, 'Node found in database.');
 
     // Loads node page and check if Language field is hidden by default.
     $this->drupalGet('node/' . $node->id());
diff --git a/core/modules/node/tests/src/Functional/NodeViewTest.php b/core/modules/node/tests/src/Functional/NodeViewTest.php
index b0eaa47..401df39 100644
--- a/core/modules/node/tests/src/Functional/NodeViewTest.php
+++ b/core/modules/node/tests/src/Functional/NodeViewTest.php
@@ -25,10 +25,10 @@ public function testHtmlHeadLinks() {
 
     // Link relations are checked for access for anonymous users.
     $result = $this->xpath('//link[@rel = "version-history"]');
-    $this->assertFalse($result, 'Version history not present for anonymous users without access.');
+    $this->assertEmpty($result, 'Version history not present for anonymous users without access.');
 
     $result = $this->xpath('//link[@rel = "edit-form"]');
-    $this->assertFalse($result, 'Edit form not present for anonymous users without access.');
+    $this->assertEmpty($result, 'Edit form not present for anonymous users without access.');
 
     $this->drupalLogin($this->createUser(['access content']));
     $this->drupalGet($node->urlInfo());
@@ -59,7 +59,7 @@ public function testHtmlHeadLinks() {
     $this->assertEqual($result[0]->getAttribute('href'), $node->url());
 
     $result = $this->xpath('//link[@rel = "version-history"]');
-    $this->assertFalse($result, 'Version history not present for anonymous users without access.');
+    $this->assertEmpty($result, 'Version history not present for anonymous users without access.');
 
     $result = $this->xpath('//link[@rel = "edit-form"]');
     $this->assertEqual($result[0]->getAttribute('href'), $node->url('edit-form'));
diff --git a/core/modules/node/tests/src/Functional/PageViewTest.php b/core/modules/node/tests/src/Functional/PageViewTest.php
index 9f7e414..3faff83 100644
--- a/core/modules/node/tests/src/Functional/PageViewTest.php
+++ b/core/modules/node/tests/src/Functional/PageViewTest.php
@@ -16,7 +16,7 @@ class PageViewTest extends NodeTestBase {
   public function testPageView() {
     // Create a node to view.
     $node = $this->drupalCreateNode();
-    $this->assertTrue(Node::load($node->id()), 'Node created.');
+    $this->assertNotEmpty(Node::load($node->id()), 'Node created.');
 
     // Try to edit with anonymous user.
     $this->drupalGet("node/" . $node->id() . "/edit");
diff --git a/core/modules/node/tests/src/Functional/Views/BulkFormTest.php b/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
index 458933e..a0f41bb 100644
--- a/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
+++ b/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
@@ -251,7 +251,7 @@ public function testBulkDeletion() {
     $node = $this->loadNode(4);
     $this->assertNull($node, '4: Node has been deleted');
     $node = $this->loadNode(5);
-    $this->assertTrue($node, '5: Node has not been deleted');
+    $this->assertNotEmpty($node, '5: Node has not been deleted');
 
     $this->assertText('Deleted 8 posts.');
   }
diff --git a/core/modules/node/tests/src/Functional/Views/FrontPageTest.php b/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
index 37a6b91..052afde 100644
--- a/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
+++ b/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
@@ -165,7 +165,7 @@ protected function assertNotInResultSet(ViewExecutable $view, array $not_expecte
     $found_nids = array_filter($view->result, function ($row) use ($not_expected_nids) {
       return in_array($row->nid, $not_expected_nids);
     });
-    $this->assertFalse($found_nids, $message);
+    $this->assertEmpty($found_nids, $message);
   }
 
   /**
diff --git a/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php b/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php
index cb98517..29b764b 100644
--- a/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php
+++ b/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php
@@ -38,13 +38,13 @@ public function testImportCreateDefault() {
     $node_type_id = 'default';
 
     // Check that the content type does not exist yet.
-    $this->assertFalse(NodeType::load($node_type_id));
+    $this->assertEmpty(NodeType::load($node_type_id));
 
     // Enable node_test_config module and check that the content type
     // shipped in the module's default config is created.
     $this->container->get('module_installer')->install(['node_test_config']);
     $node_type = NodeType::load($node_type_id);
-    $this->assertTrue($node_type, 'The default content type was created.');
+    $this->assertNotEmpty($node_type, 'The default content type was created.');
   }
 
   /**
@@ -61,15 +61,15 @@ public function testImportCreate() {
     // Manually add new node type.
     $src_dir = __DIR__ . '/../../../modules/node_test_config/sync';
     $target_dir = config_get_config_directory(CONFIG_SYNC_DIRECTORY);
-    $this->assertTrue(file_unmanaged_copy("$src_dir/$node_type_config_name.yml", "$target_dir/$node_type_config_name.yml"));
+    $this->assertNotEmpty(file_unmanaged_copy("$src_dir/$node_type_config_name.yml", "$target_dir/$node_type_config_name.yml"));
 
     // Import the content of the sync directory.
     $this->configImporter()->import();
 
     // Check that the content type was created.
     $node_type = NodeType::load($node_type_id);
-    $this->assertTrue($node_type, 'Import node type from sync was created.');
-    $this->assertFalse(FieldConfig::loadByName('node', $node_type_id, 'body'));
+    $this->assertNotEmpty($node_type, 'Import node type from sync was created.');
+    $this->assertEmpty(FieldConfig::loadByName('node', $node_type_id, 'body'));
   }
 
 }
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
index 9ca1d4a..7f68041 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
@@ -132,7 +132,7 @@ public function testNode() {
     $this->assertRevision(1, 'A Node', '1', NULL, '1441032132');
 
     $node = Node::load(1);
-    $this->assertTrue($node->field_boolean->value);
+    $this->assertNotEmpty($node->field_boolean->value);
     $this->assertIdentical('99-99-99-99', $node->field_phone->value);
     // Use assertEqual() here instead, since SQLite interprets floats strictly.
     $this->assertEqual('1', $node->field_float->value);
@@ -142,7 +142,7 @@ public function testNode() {
     $this->assertIdentical('qwerty', $node->field_text->value);
     $this->assertIdentical('2', $node->field_file->target_id);
     $this->assertIdentical('file desc', $node->field_file->description);
-    $this->assertTrue($node->field_file->display);
+    $this->assertNotEmpty($node->field_file->display);
     $this->assertIdentical('1', $node->field_images->target_id);
     $this->assertIdentical('alt text', $node->field_images->alt);
     $this->assertIdentical('title text', $node->field_images->title);
diff --git a/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php b/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php
index 3dd1349..29b7eba 100644
--- a/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    */
   public function testFieldOverrides() {
     $field_storage = FieldStorageConfig::loadByName('node', 'body');
-    $this->assertTrue($field_storage, 'Node body field storage exists.');
+    $this->assertNotEmpty($field_storage, 'Node body field storage exists.');
     $type = NodeType::create(['name' => 'Ponies', 'type' => 'ponies']);
     $type->save();
     node_add_body_field($type);
@@ -48,7 +48,7 @@ public function testFieldOverrides() {
     $this->assertTrue(count($field_storage->getBundles()) == 0, 'Node body field storage exists after deleting the only instance of a field.');
     \Drupal::service('module_installer')->uninstall(['node']);
     $field_storage = FieldStorageConfig::loadByName('node', 'body');
-    $this->assertFalse($field_storage, 'Node body field storage does not exist after uninstalling the Node module.');
+    $this->assertEmpty($field_storage, 'Node body field storage does not exist after uninstalling the Node module.');
   }
 
 }
diff --git a/core/modules/node/tests/src/Kernel/SummaryLengthTest.php b/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
index fa15c0e..6c55394 100644
--- a/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
+++ b/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
@@ -90,7 +90,7 @@ public function testSummaryLength() {
       'promote' => 1,
     ];
     $node = $this->drupalCreateNode($settings);
-    $this->assertTrue(Node::load($node->id()), 'Node created.');
+    $this->assertNotEmpty(Node::load($node->id()), 'Node created.');
 
     // Render the node as a teaser.
     $content = $this->drupalBuildEntityView($node, 'teaser');
diff --git a/core/modules/path/tests/src/Functional/PathAliasTest.php b/core/modules/path/tests/src/Functional/PathAliasTest.php
index 6299778..57aac82 100644
--- a/core/modules/path/tests/src/Functional/PathAliasTest.php
+++ b/core/modules/path/tests/src/Functional/PathAliasTest.php
@@ -52,14 +52,14 @@ public function testPathCache() {
     \Drupal::cache('data')->deleteAll();
     // Make sure the path is not converted to the alias.
     $this->drupalGet(trim($edit['source'], '/'), ['alias' => TRUE]);
-    $this->assertTrue(\Drupal::cache('data')->get('preload-paths:' . $edit['source']), 'Cache entry was created.');
+    $this->assertNotEmpty(\Drupal::cache('data')->get('preload-paths:' . $edit['source']), 'Cache entry was created.');
 
     // Visit the alias for the node and confirm a cache entry is created.
     \Drupal::cache('data')->deleteAll();
     // @todo Remove this once https://www.drupal.org/node/2480077 lands.
     Cache::invalidateTags(['rendered']);
     $this->drupalGet(trim($edit['alias'], '/'));
-    $this->assertTrue(\Drupal::cache('data')->get('preload-paths:' . $edit['source']), 'Cache entry was created.');
+    $this->assertNotEmpty(\Drupal::cache('data')->get('preload-paths:' . $edit['source']), 'Cache entry was created.');
   }
 
   /**
diff --git a/core/modules/path/tests/src/Functional/PathLanguageTest.php b/core/modules/path/tests/src/Functional/PathLanguageTest.php
index 8e41ede..72c9483 100644
--- a/core/modules/path/tests/src/Functional/PathLanguageTest.php
+++ b/core/modules/path/tests/src/Functional/PathLanguageTest.php
@@ -120,7 +120,7 @@ public function testAliasTranslation() {
     $languages = $this->container->get('language_manager')->getLanguages();
     $url = $english_node_french_translation->url('canonical', ['language' => $languages['fr']]);
 
-    $this->assertTrue(strpos($url, $edit['path[0][alias]']), 'URL contains the path alias.');
+    $this->assertNotEmpty(strpos($url, $edit['path[0][alias]']), 'URL contains the path alias.');
 
     // Confirm that the alias works even when changing language negotiation
     // options. Enable User language detection and selection over URL one.
diff --git a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
index 092d5ac..84615b7 100644
--- a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
+++ b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
@@ -49,7 +49,7 @@ protected function setUp() {
    *   The path.
    */
   private function assertPath($pid, $conditions, $path) {
-    $this->assertTrue($path, "Path alias for " . $conditions['source'] . " successfully loaded.");
+    $this->assertNotEmpty($path, "Path alias for " . $conditions['source'] . " successfully loaded.");
     $this->assertIdentical($conditions['alias'], $path['alias']);
     $this->assertIdentical($conditions['langcode'], $path['langcode']);
     $this->assertIdentical($conditions['source'], $path['source']);
diff --git a/core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php b/core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php
index 5c7d385..7328ca5 100644
--- a/core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php
+++ b/core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php
@@ -23,7 +23,7 @@ public function testIntegerFormatter() {
 
     // Test that the content attribute is not created.
     $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
-    $this->assertFalse($result);
+    $this->assertEmpty($result);
   }
 
   /**
@@ -51,7 +51,7 @@ public function testIntegerFormatterWithSettings() {
 
     // Test that the content attribute is created.
     $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', [':testValue' => $testValue]);
-    $this->assertTrue($result);
+    $this->assertNotEmpty($result);
   }
 
   /**
@@ -66,7 +66,7 @@ public function testFloatFormatter() {
 
     // Test that the content attribute is not created.
     $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
-    $this->assertFalse($result);
+    $this->assertEmpty($result);
   }
 
   /**
@@ -95,7 +95,7 @@ public function testFloatFormatterWithSettings() {
 
     // Test that the content attribute is created.
     $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', [':testValue' => $testValue]);
-    $this->assertTrue($result);
+    $this->assertNotEmpty($result);
   }
 
   /**
@@ -116,7 +116,7 @@ public function testFloatFormatterWithScale() {
 
     // Test that the content attribute is not created.
     $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
-    $this->assertFalse($result);
+    $this->assertEmpty($result);
   }
 
   /**
@@ -139,7 +139,7 @@ public function testFloatFormatterWithScaleExercised() {
 
     // Test that the content attribute is created.
     $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', [':testValue' => $testValue]);
-    $this->assertTrue($result);
+    $this->assertNotEmpty($result);
   }
 
   /**
@@ -154,7 +154,7 @@ public function testDecimalFormatter() {
 
     // Test that the content attribute is not created.
     $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
-    $this->assertFalse($result);
+    $this->assertEmpty($result);
   }
 
   /**
@@ -183,7 +183,7 @@ public function testDecimalFormatterWithSettings() {
 
     // Test that the content attribute is created.
     $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', [':testValue' => $testValue]);
-    $this->assertTrue($result);
+    $this->assertNotEmpty($result);
   }
 
   /**
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
index eeaf793..d0f928b 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
@@ -86,7 +86,7 @@ public function testResponsiveImageAdmin() {
 
       foreach ($image_styles as $image_style_name) {
         // Check if the image styles are available in the dropdowns.
-        $this->assertTrue($this->xpath(
+        $this->assertNotEmpty($this->xpath(
           '//select[@name=:name]//option[@value=:style]',
           [
             ':name' => 'keyed_styles[responsive_image_test_module.' . $case[0] . '][' . $case[1] . '][image_style]',
diff --git a/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php b/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php
index d481291..b35751c 100644
--- 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.
diff --git a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
index cb9fee2..b41b47b 100644
--- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
@@ -290,14 +290,14 @@ public function testRestRenderCaching() {
     $this->assertHeader('content-type', 'application/json');
     $this->assertCacheContexts($cache_contexts);
     $this->assertCacheTags($cache_tags);
-    $this->assertTrue($render_cache->get($original));
+    $this->assertNotEmpty($render_cache->get($original));
 
     $result_xml = $this->drupalGet('test/serialize/entity', ['query' => ['_format' => 'xml']]);
     $this->addRequestWithFormat('xml');
     $this->assertHeader('content-type', 'text/xml; charset=UTF-8');
     $this->assertCacheContexts($cache_contexts);
     $this->assertCacheTags($cache_tags);
-    $this->assertTrue($render_cache->get($original));
+    $this->assertNotEmpty($render_cache->get($original));
 
     // Ensure that the XML output is different from the JSON one.
     $this->assertNotEqual($result1, $result_xml);
@@ -309,7 +309,7 @@ public function testRestRenderCaching() {
     $this->assertEqual($result2, $result1);
     $this->assertCacheContexts($cache_contexts);
     $this->assertCacheTags($cache_tags);
-    $this->assertTrue($render_cache->get($original));
+    $this->assertNotEmpty($render_cache->get($original));
 
     // Create a new entity and ensure that the cache tags are taken over.
     EntityTest::create(['name' => 'test_11', 'user_id' => $this->adminUser->id()])->save();
@@ -325,7 +325,7 @@ public function testRestRenderCaching() {
 
     $this->assertCacheContexts($cache_contexts);
     $this->assertCacheTags($cache_tags);
-    $this->assertTrue($render_cache->get($original));
+    $this->assertNotEmpty($render_cache->get($original));
   }
 
   /**
diff --git a/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php b/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php
index f3a8f04..5246e48 100644
--- 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 */
diff --git a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
index f4c22bd..73aec50 100644
--- a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
+++ b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
@@ -63,13 +63,13 @@ protected function setUp() {
    */
   public function testStatisticsSettings() {
     $config = $this->config('statistics.settings');
-    $this->assertFalse($config->get('count_content_views'), 'Count content view log is disabled by default.');
+    $this->assertEmpty($config->get('count_content_views'), 'Count content view log is disabled by default.');
 
     // Enable counter on content view.
     $edit['statistics_count_content_views'] = 1;
     $this->drupalPostForm('admin/config/system/statistics', $edit, t('Save configuration'));
     $config = $this->config('statistics.settings');
-    $this->assertTrue($config->get('count_content_views'), 'Count content view log is enabled.');
+    $this->assertNotEmpty($config->get('count_content_views'), 'Count content view log is enabled.');
 
     // Hit the node.
     $this->drupalGet('node/' . $this->testNode->id());
@@ -167,7 +167,7 @@ public function testExpiredLogs() {
       ->condition('nid', $this->testNode->id(), '=')
       ->execute()
       ->fetchField();
-    $this->assertFalse($result, 'Daycounter is zero.');
+    $this->assertEmpty($result, 'Daycounter is zero.');
   }
 
 }
diff --git a/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php b/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
index 2d7c7ae..84943e0 100644
--- a/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
+++ b/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
@@ -113,7 +113,7 @@ public function testBatchFormMultistep() {
     $this->drupalGet('batch-test/multistep', ['query' => ['big_tree' => 'small_axe']]);
     $this->drupalPostForm(NULL, [], 'Submit');
     $this->assertText('step 2', 'Form is displayed in step 2.');
-    $this->assertTrue(strpos($this->getUrl(), 'batch-test/multistep?big_tree=small_axe'), 'Query argument was persisted and another extra argument was added.');
+    $this->assertNotEmpty(strpos($this->getUrl(), 'batch-test/multistep?big_tree=small_axe'), 'Query argument was persisted and another extra argument was added.');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/Cache/ClearTest.php b/core/modules/system/tests/src/Functional/Cache/ClearTest.php
index bec6d50..9fc283e 100644
--- a/core/modules/system/tests/src/Functional/Cache/ClearTest.php
+++ b/core/modules/system/tests/src/Functional/Cache/ClearTest.php
@@ -24,7 +24,7 @@ protected function setUp() {
   public function testFlushAllCaches() {
     // Create cache entries for each flushed cache bin.
     $bins = Cache::getBins();
-    $this->assertTrue($bins, 'Cache::getBins() returned bins to flush.');
+    $this->assertNotEmpty($bins, 'Cache::getBins() returned bins to flush.');
     foreach ($bins as $bin => $cache_backend) {
       $cid = 'test_cid_clear' . $bin;
       $cache_backend->set($cid, $this->defaultValue);
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
index 684e0be..db6b95b 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
@@ -99,7 +99,7 @@ public function testFieldItemAttributes() {
     // field item HTML markup.
     $this->drupalGet('entity_test/' . $entity->id());
     $xpath = $this->xpath('//div[@data-field-item-attr="foobar"]/p[text()=:value]', [':value' => $test_value]);
-    $this->assertTrue($xpath, 'The field item attribute has been found in the rendered output of the field.');
+    $this->assertNotEmpty($xpath, 'The field item attribute has been found in the rendered output of the field.');
 
     // Enable the RDF module to ensure that two modules can add attributes to
     // the same field item.
@@ -116,7 +116,7 @@ public function testFieldItemAttributes() {
     // are rendered in the field item HTML markup.
     $this->drupalGet('entity_test/' . $entity->id());
     $xpath = $this->xpath('//div[@data-field-item-attr="foobar" and @property="schema:text"]/p[text()=:value]', [':value' => $test_value]);
-    $this->assertTrue($xpath, 'The field item attributes from both modules have been found in the rendered output of the field.');
+    $this->assertNotEmpty($xpath, 'The field item attributes from both modules have been found in the rendered output of the field.');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTest.php b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTest.php
index 625ee19..36ea655 100644
--- a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTest.php
@@ -109,7 +109,7 @@ public function testMakeRevisionable() {
 
       // Check that the correct initial value was provided for the
       // 'revision_translation_affected' field.
-      $this->assertTrue($revision->revision_translation_affected->value);
+      $this->assertNotEmpty($revision->revision_translation_affected->value);
 
       $this->assertEqual($i . ' - test single property', $revision->test_single_property->value);
 
diff --git a/core/modules/system/tests/src/Functional/Form/ElementTest.php b/core/modules/system/tests/src/Functional/Form/ElementTest.php
index 57da8da..9a7a667 100644
--- a/core/modules/system/tests/src/Functional/Form/ElementTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ElementTest.php
@@ -82,7 +82,7 @@ public function testOptions() {
         ':id' => 'edit-' . $type . '-foo',
         ':class' => 'description',
       ]);
-      $this->assertTrue(count($elements), format_string('Custom %type option description found.', [
+      $this->assertNotEmpty(count($elements), format_string('Custom %type option description found.', [
         '%type' => $type,
       ]));
     }
@@ -182,13 +182,13 @@ public function testGroupElements() {
    */
   public function testRequiredFieldsetsAndDetails() {
     $this->drupalGet('form-test/group-details');
-    $this->assertFalse($this->cssSelect('summary.form-required'));
+    $this->assertEmpty($this->cssSelect('summary.form-required'));
     $this->drupalGet('form-test/group-details/1');
-    $this->assertTrue($this->cssSelect('summary.form-required'));
+    $this->assertNotEmpty($this->cssSelect('summary.form-required'));
     $this->drupalGet('form-test/group-fieldset');
-    $this->assertFalse($this->cssSelect('span.form-required'));
+    $this->assertEmpty($this->cssSelect('span.form-required'));
     $this->drupalGet('form-test/group-fieldset/1');
-    $this->assertTrue($this->cssSelect('span.form-required'));
+    $this->assertNotEmpty($this->cssSelect('span.form-required'));
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php
index 87c7632..d91e394 100644
--- a/core/modules/system/tests/src/Functional/Form/FormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/FormTest.php
@@ -128,13 +128,13 @@ public function testRequiredFields() {
             $this->assertTrue(isset($errors[$element]), "Check empty($key) '$type' field '$element'");
             if (!empty($form_output)) {
               // Make sure the form element is marked as required.
-              $this->assertTrue(preg_match($required_marker_preg, $form_output), "Required '$type' field is marked as required");
+              $this->assertNotEmpty(preg_match($required_marker_preg, $form_output), "Required '$type' field is marked as required");
             }
           }
           else {
             if (!empty($form_output)) {
               // Make sure the form element is *not* marked as required.
-              $this->assertFalse(preg_match($required_marker_preg, $form_output), "Optional '$type' field is not marked as required");
+              $this->assertEmpty(preg_match($required_marker_preg, $form_output), "Optional '$type' field is not marked as required");
             }
             if ($type == 'select') {
               // Select elements are going to have validation errors with empty
diff --git a/core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php b/core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php
index 09ad06a..c23ad47 100644
--- a/core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php
@@ -24,7 +24,7 @@ class SystemConfigFormTest extends BrowserTestBase {
   public function testSystemConfigForm() {
     $this->drupalGet('form-test/system-config-form');
     $element = $this->xpath('//div[@id = :id]/input[contains(@class, :class)]', [':id' => 'edit-actions', ':class' => 'button--primary']);
-    $this->assertTrue($element, 'The primary action submit button was found.');
+    $this->assertNotEmpty($element, 'The primary action submit button was found.');
     $this->drupalPostForm(NULL, [], t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'));
   }
diff --git a/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php b/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php
index bdbfd74..8a445d8 100644
--- a/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php
+++ b/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php
@@ -234,7 +234,7 @@ public function testDrupalHtmlToTextBlockTagToNewline() {
       . '<li>[li-ul]</li></ul>'
       . '[text]';
     $output = MailFormatHelper::htmlToText($input);
-    $pass = $this->assertFalse(
+    $pass = $this->assertEmpty(
       preg_match('/\][^\n]*\[/s', $output),
       'Block-level HTML tags should force newlines'
     );
diff --git a/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php b/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
index 12a157d..bfe66b2 100644
--- a/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
@@ -51,7 +51,7 @@ protected function assertLocalTasks(array $routes, $level = 0) {
     $elements = $this->xpath('//*[contains(@class, :class)]//a', [
       ':class' => $level == 0 ? 'tabs primary' : 'tabs secondary',
     ]);
-    $this->assertTrue(count($elements), 'Local tasks found.');
+    $this->assertNotEmpty(count($elements), 'Local tasks found.');
     foreach ($routes as $index => $route_info) {
       list($route_name, $route_parameters) = $route_info;
       $expected = Url::fromRoute($route_name, $route_parameters)->toString();
@@ -92,7 +92,7 @@ protected function assertNoLocalTasks($level = 0) {
     $elements = $this->xpath('//*[contains(@class, :class)]//a', [
       ':class' => $level == 0 ? 'tabs primary' : 'tabs secondary',
     ]);
-    $this->assertFalse(count($elements), 'Local tasks not found.');
+    $this->assertEmpty(count($elements), 'Local tasks not found.');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/Module/UninstallTest.php b/core/modules/system/tests/src/Functional/Module/UninstallTest.php
index 2b17b8f..422ee4d 100644
--- a/core/modules/system/tests/src/Functional/Module/UninstallTest.php
+++ b/core/modules/system/tests/src/Functional/Module/UninstallTest.php
@@ -32,7 +32,7 @@ public function testUserPermsUninstalled() {
     $this->container->get('module_installer')->uninstall(['module_test']);
 
     // Are the perms defined by module_test removed?
-    $this->assertFalse(user_roles(FALSE, 'module_test perm'), 'Permissions were all removed.');
+    $this->assertEmpty(user_roles(FALSE, 'module_test perm'), 'Permissions were all removed.');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/System/DateTimeTest.php b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
index 3d35f96..cb7e0e1 100644
--- a/core/modules/system/tests/src/Functional/System/DateTimeTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
@@ -121,7 +121,7 @@ public function testDateFormatConfiguration() {
 
     // Make sure the date does not exist in config.
     $date_format = DateFormat::load($date_format_id);
-    $this->assertFalse($date_format);
+    $this->assertNull($date_format);
 
     // Add a new date format with an existing format.
     $date_format_id = strtolower($this->randomMachineName(8));
diff --git a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php b/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php
index f7dcd0c..e15ba4f 100644
--- a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php
+++ b/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php
@@ -83,7 +83,7 @@ public function testAddingTheRevisionTranslationAffectedField() {
     // Check that the correct initial value was set when the field was
     // installed.
     $entity = $this->entityManager->getStorage('entity_test_update')->load(1);
-    $this->assertTrue($entity->revision_translation_affected->value);
+    $this->assertNotEmpty($entity->revision_translation_affected->value);
   }
 
 }
diff --git a/core/modules/system/tests/src/Functional/Update/InstallProfileSystemInstall8300Test.php b/core/modules/system/tests/src/Functional/Update/InstallProfileSystemInstall8300Test.php
index 623f880..20bcb2b 100644
--- a/core/modules/system/tests/src/Functional/Update/InstallProfileSystemInstall8300Test.php
+++ b/core/modules/system/tests/src/Functional/Update/InstallProfileSystemInstall8300Test.php
@@ -29,7 +29,7 @@ public function testUpdate() {
     // expected state before updating.
     $this->assertEqual('standard', \Drupal::installProfile());
     $this->assertEqual('standard', Settings::get('install_profile'), 'The install profile has not been written to settings.php.');
-    $this->assertFalse($this->config('core.extension')->get('profile'), 'The install profile is not present in core.extension configuration.');
+    $this->assertNull($this->config('core.extension')->get('profile'), 'The install profile is not present in core.extension configuration.');
 
     $this->runUpdates();
     // Confirm that Drupal recognizes this distribution as the current profile.
diff --git a/core/modules/system/tests/src/Functional/Update/LocalActionsAndTasksConvertedIntoBlocksUpdateTest.php b/core/modules/system/tests/src/Functional/Update/LocalActionsAndTasksConvertedIntoBlocksUpdateTest.php
index a54bb6d..cadfcf4 100644
--- a/core/modules/system/tests/src/Functional/Update/LocalActionsAndTasksConvertedIntoBlocksUpdateTest.php
+++ b/core/modules/system/tests/src/Functional/Update/LocalActionsAndTasksConvertedIntoBlocksUpdateTest.php
@@ -74,7 +74,7 @@ public function testUpdateHookN() {
     // Local actions are visible on the content listing page.
     $this->drupalGet('admin/content');
     $action_link = $this->cssSelect('.action-links');
-    $this->assertTrue($action_link);
+    $this->assertNotEmpty($action_link);
 
     $this->drupalGet('admin/structure/block/list/seven');
 
diff --git a/core/modules/system/tests/src/Functional/Update/SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest.php b/core/modules/system/tests/src/Functional/Update/SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest.php
index 341b37b..80efdf9 100644
--- a/core/modules/system/tests/src/Functional/Update/SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest.php
+++ b/core/modules/system/tests/src/Functional/Update/SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest.php
@@ -53,7 +53,7 @@ public function testUpdateHookN() {
     // Local actions are visible on the content listing page.
     $this->drupalGet('admin/structure/block');
     $action_link = $this->cssSelect('#secondary-tabs-title');
-    $this->assertTrue($action_link);
+    $this->assertNotEmpty($action_link);
   }
 
 }
diff --git a/core/modules/system/tests/src/Functional/Update/UpdateScriptTest.php b/core/modules/system/tests/src/Functional/Update/UpdateScriptTest.php
index 29d4d08..babb166 100644
--- a/core/modules/system/tests/src/Functional/Update/UpdateScriptTest.php
+++ b/core/modules/system/tests/src/Functional/Update/UpdateScriptTest.php
@@ -189,7 +189,7 @@ public function testNoUpdateFunctionality() {
    */
   public function testSuccessfulUpdateFunctionality() {
     $initial_maintenance_mode = $this->container->get('state')->get('system.maintenance_mode');
-    $this->assertFalse($initial_maintenance_mode, 'Site is not in maintenance mode.');
+    $this->assertNull($initial_maintenance_mode, 'Site is not in maintenance mode.');
     $this->runUpdates($initial_maintenance_mode);
     $final_maintenance_mode = $this->container->get('state')->get('system.maintenance_mode');
     $this->assertEqual($final_maintenance_mode, $initial_maintenance_mode, 'Maintenance mode should not have changed after database updates.');
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php
index 08f70cf..253e74f 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php
@@ -36,7 +36,7 @@ public function testMigrateThemeSettings() {
     $this->assertTrue($config->get('features.comment_user_verification'));
     $this->assertTrue($config->get('features.favicon'));
     $this->assertTrue($config->get('features.node_user_picture'));
-    $this->assertFalse($config->get('features.logo'));
+    $this->assertNull($config->get('features.logo'));
     $this->assertTrue($config->get('features.name'));
     $this->assertTrue($config->get('features.slogan'));
     $this->assertSame('public://gnu.png', $config->get('logo.path'));
@@ -49,7 +49,7 @@ public function testMigrateThemeSettings() {
     $this->assertTrue($config->get('features.comment_user_verification'));
     $this->assertTrue($config->get('features.favicon'));
     $this->assertTrue($config->get('features.node_user_picture'));
-    $this->assertFalse($config->get('features.logo'));
+    $this->assertNull($config->get('features.logo'));
     $this->assertTrue($config->get('features.name'));
     $this->assertTrue($config->get('features.slogan'));
     $this->assertSame('', $config->get('logo.path'));
diff --git a/core/modules/system/tests/src/Kernel/System/CronQueueTest.php b/core/modules/system/tests/src/Kernel/System/CronQueueTest.php
index 649a2c7..0c8c646 100644
--- 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());
   }
 
 }
diff --git a/core/modules/taxonomy/tests/src/Functional/LoadMultipleTest.php b/core/modules/taxonomy/tests/src/Functional/LoadMultipleTest.php
index 186031c..ee880ea 100644
--- a/core/modules/taxonomy/tests/src/Functional/LoadMultipleTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/LoadMultipleTest.php
@@ -44,7 +44,7 @@ public function testTaxonomyTermMultipleLoad() {
     $deleted = array_shift($terms2);
     $deleted->delete();
     $deleted_term = Term::load($deleted->id());
-    $this->assertFalse($deleted_term);
+    $this->assertNull($deleted_term);
 
     // Load terms from the vocabulary by vid.
     $terms3 = entity_load_multiple_by_properties('taxonomy_term', ['vid' => $vocabulary->id()]);
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
index 80ea2d7..a4febb5 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
@@ -119,7 +119,7 @@ public function testTaxonomyAdminNoVocabularies() {
       $vocabulary->delete();
     }
     // Confirm that no vocabularies are found in the database.
-    $this->assertFalse(Vocabulary::loadMultiple(), 'No vocabularies found.');
+    $this->assertEmpty(Vocabulary::loadMultiple(), 'No vocabularies found.');
     $this->drupalGet('admin/structure/taxonomy');
     // Check the default message for no vocabularies.
     $this->assertText(t('No vocabularies available.'));
@@ -141,7 +141,7 @@ public function testTaxonomyAdminDeletingVocabulary() {
     // Check the created vocabulary.
     $this->container->get('entity.manager')->getStorage('taxonomy_vocabulary')->resetCache();
     $vocabulary = Vocabulary::load($vid);
-    $this->assertTrue($vocabulary, 'Vocabulary found.');
+    $this->assertNotEmpty($vocabulary, 'Vocabulary found.');
 
     // Delete the vocabulary.
     $this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id());
@@ -153,7 +153,7 @@ public function testTaxonomyAdminDeletingVocabulary() {
     $this->drupalPostForm(NULL, NULL, t('Delete'));
     $this->assertRaw(t('Deleted vocabulary %name.', ['%name' => $vocabulary->label()]), 'Vocabulary deleted.');
     $this->container->get('entity.manager')->getStorage('taxonomy_vocabulary')->resetCache();
-    $this->assertFalse(Vocabulary::load($vid), 'Vocabulary not found.');
+    $this->assertNull(Vocabulary::load($vid), 'Vocabulary not found.');
   }
 
 }
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php
index 2da51e4..d601a4b 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php
@@ -72,12 +72,12 @@ public function testStubWithWeightMapping() {
     $migration = $this->getMigration('taxonomy_term_stub_test');
     $term_executable = new MigrateExecutable($migration, $this);
     $term_executable->import();
-    $this->assertTrue($migration->getIdMap()->getRowBySource(['2']), 'Stub row exists in the ID map table');
+    $this->assertNotEmpty($migration->getIdMap()->getRowBySource(['2']), 'Stub row exists in the ID map table');
 
     // Load the referenced term, which should exist as a stub.
     /** @var \Drupal\Core\Entity\ContentEntityBase $stub_entity */
     $stub_entity = Term::load(2);
-    $this->assertTrue($stub_entity, 'Stub successfully created');
+    $this->assertNotEmpty($stub_entity, 'Stub successfully created');
     if ($stub_entity) {
       $this->assertIdentical(count($stub_entity->validate()), 0, 'Stub is a valid entity');
     }
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
index 9585c86..677bb72 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
@@ -201,7 +201,7 @@ public function testUserRoleUpdateSubtreesHashCacheClear() {
 
     // Assert that the old admin menu subtree hash and the new admin menu
     // subtree hash are the same.
-    $this->assertTrue($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
+    $this->assertNotEmpty($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
     $this->assertEqual($admin_user_2_hash, $new_subtree_hash, 'The user-specific subtree menu hash has not been updated.');
   }
 
@@ -237,7 +237,7 @@ public function testNonCurrentUserAccountUpdates() {
 
     // Assert that the old adminUser subtree hash and the new adminUser
     // subtree hash are the same.
-    $this->assertTrue($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
+    $this->assertNotEmpty($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
     $this->assertEqual($admin_user_2_hash, $new_subtree_hash, 'The user-specific subtree menu hash has not been updated.');
   }
 
@@ -278,7 +278,7 @@ public function testLocaleTranslationSubtreesHashCacheClear() {
     // Get a baseline hash for the admin menu subtrees before translating one
     // of the menu link items.
     $original_subtree_hash = $this->getSubtreesHash();
-    $this->assertTrue($original_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
+    $this->assertNotEmpty($original_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
     $this->drupalLogout();
 
     // Translate the string 'Search and metadata' in the xx language. This
@@ -318,7 +318,7 @@ public function testLocaleTranslationSubtreesHashCacheClear() {
 
     // Assert that the old admin menu subtrees hash and the new admin menu
     // subtrees hash are different.
-    $this->assertTrue($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
+    $this->assertNotEmpty($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
     $this->assertNotEqual($original_subtree_hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.');
   }
 
@@ -357,7 +357,7 @@ public function testLanguageSwitching() {
 
     // Assert that the old admin menu subtree hash and the new admin menu
     // subtree hash are different.
-    $this->assertTrue($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
+    $this->assertNotEmpty($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
     $this->assertNotEqual($this->hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.');
   }
 
@@ -368,7 +368,7 @@ public function testBackToSiteLink() {
     // Back to site link should exist in the markup.
     $this->drupalGet('test-page');
     $back_link = $this->cssSelect('.home-toolbar-tab');
-    $this->assertTrue($back_link);
+    $this->assertNotEmpty($back_link);
   }
 
   /**
@@ -420,7 +420,7 @@ private function assertDifferentHash() {
 
     // Assert that the old admin menu subtree hash and the new admin menu
     // subtree hash are different.
-    $this->assertTrue($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
+    $this->assertNotEmpty($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.');
     $this->assertNotEqual($this->hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.');
 
     // Save the new subtree hash as the original.
diff --git a/core/modules/user/tests/src/Functional/Update/UserUpdateEmailToken.php b/core/modules/user/tests/src/Functional/Update/UserUpdateEmailToken.php
index a01c8a5..47c7029 100644
--- a/core/modules/user/tests/src/Functional/Update/UserUpdateEmailToken.php
+++ b/core/modules/user/tests/src/Functional/Update/UserUpdateEmailToken.php
@@ -26,10 +26,10 @@ protected function setDatabaseDumpFiles() {
    */
   public function testEmailToken() {
     $mail = \Drupal::config('user.mail')->get('status_blocked');
-    $this->assertTrue(strpos($mail['body'], '[site:account-name]'));
+    $this->assertNotEmpty(strpos($mail['body'], '[site:account-name]'));
     $this->runUpdates();
     $mail = \Drupal::config('user.mail')->get('status_blocked');
-    $this->assertFalse(strpos($mail['body'], '[site:account-name]'));
+    $this->assertEmpty(strpos($mail['body'], '[site:account-name]'));
   }
 
 }
diff --git a/core/modules/user/tests/src/Functional/UserCancelTest.php b/core/modules/user/tests/src/Functional/UserCancelTest.php
index 83020b4..717deb5 100644
--- a/core/modules/user/tests/src/Functional/UserCancelTest.php
+++ b/core/modules/user/tests/src/Functional/UserCancelTest.php
@@ -85,7 +85,7 @@ public function testUserCancelChangePermission() {
 
     // Confirm deletion.
     $this->assertRaw(t('%name has been deleted.', ['%name' => $account->getUsername()]), 'User deleted.');
-    $this->assertFalse(User::load($account->id()), 'User is not found in the database.');
+    $this->assertNull(User::load($account->id()), 'User is not found in the database.');
   }
 
   /**
@@ -345,7 +345,7 @@ public function testUserAnonymize() {
     // Confirm account cancellation request.
     $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account, $timestamp));
     $user_storage->resetCache([$account->id()]);
-    $this->assertFalse($user_storage->load($account->id()), 'User is not found in the database.');
+    $this->assertNull($user_storage->load($account->id()), 'User is not found in the database.');
 
     // Confirm that user's content has been attributed to anonymous user.
     $anonymous_user = User::getAnonymousUser();
@@ -405,7 +405,7 @@ public function testUserAnonymizeBatch() {
     // Confirm account cancellation request.
     $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account, $timestamp));
     $user_storage->resetCache([$account->id()]);
-    $this->assertFalse($user_storage->load($account->id()), 'User is not found in the database.');
+    $this->assertNull($user_storage->load($account->id()), 'User is not found in the database.');
 
     // Confirm that user's content has been attributed to anonymous user.
     $node_storage->resetCache(array_keys($nodes));
@@ -446,7 +446,7 @@ public function testUserDelete() {
     $this->assertText(t('Your comment has been posted.'));
     $comments = entity_load_multiple_by_properties('comment', ['subject' => $edit['subject[0][value]']]);
     $comment = reset($comments);
-    $this->assertTrue($comment->id(), 'Comment found.');
+    $this->assertNotEmpty($comment->id(), 'Comment found.');
 
     // Create a node with two revisions, the initial one belonging to the
     // cancelling user.
@@ -471,16 +471,16 @@ public function testUserDelete() {
     // Confirm account cancellation request.
     $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account, $timestamp));
     $user_storage->resetCache([$account->id()]);
-    $this->assertFalse($user_storage->load($account->id()), 'User is not found in the database.');
+    $this->assertNull($user_storage->load($account->id()), 'User is not found in the database.');
 
     // Confirm that user's content has been deleted.
     $node_storage->resetCache([$node->id()]);
-    $this->assertFalse($node_storage->load($node->id()), 'Node of the user has been deleted.');
-    $this->assertFalse(node_revision_load($revision), 'Node revision of the user has been deleted.');
+    $this->assertNull($node_storage->load($node->id()), 'Node of the user has been deleted.');
+    $this->assertNull(node_revision_load($revision), 'Node revision of the user has been deleted.');
     $node_storage->resetCache([$revision_node->id()]);
-    $this->assertTrue($node_storage->load($revision_node->id()), "Current revision of the user's node was not deleted.");
+    $this->assertNotEmpty($node_storage->load($revision_node->id()), "Current revision of the user's node was not deleted.");
     \Drupal::entityManager()->getStorage('comment')->resetCache([$comment->id()]);
-    $this->assertFalse(Comment::load($comment->id()), 'Comment of the user has been deleted.');
+    $this->assertNull(Comment::load($comment->id()), 'Comment of the user has been deleted.');
 
     // Confirm that the confirmation message made it through to the end user.
     $this->assertRaw(t('%name has been deleted.', ['%name' => $account->getUsername()]), "Confirmation message displayed to user.");
@@ -508,7 +508,7 @@ public function testUserCancelByAdmin() {
     // Confirm deletion.
     $this->drupalPostForm(NULL, NULL, t('Cancel account'));
     $this->assertRaw(t('%name has been deleted.', ['%name' => $account->getUsername()]), 'User deleted.');
-    $this->assertFalse(User::load($account->id()), 'User is not found in the database.');
+    $this->assertNull(User::load($account->id()), 'User is not found in the database.');
   }
 
   /**
@@ -536,7 +536,7 @@ public function testUserWithoutEmailCancelByAdmin() {
     // Confirm deletion.
     $this->drupalPostForm(NULL, NULL, t('Cancel account'));
     $this->assertRaw(t('%name has been deleted.', ['%name' => $account->getUsername()]), 'User deleted.');
-    $this->assertFalse(User::load($account->id()), 'User is not found in the database.');
+    $this->assertNull(User::load($account->id()), 'User is not found in the database.');
   }
 
   /**
diff --git a/core/modules/user/tests/src/Functional/UserDeleteTest.php b/core/modules/user/tests/src/Functional/UserDeleteTest.php
index 5803a04..1376a72 100644
--- a/core/modules/user/tests/src/Functional/UserDeleteTest.php
+++ b/core/modules/user/tests/src/Functional/UserDeleteTest.php
@@ -34,7 +34,7 @@ public function testUserDeleteMultiple() {
 
     $this->assertTrue($roles_created > 0, 'Role assignments created for new users and deletion of role assignments can be tested');
     // We should be able to load one of the users.
-    $this->assertTrue(User::load($user_a->id()), 'User is created and deletion of user can be tested');
+    $this->assertNotEmpty(User::load($user_a->id()), 'User is created and deletion of user can be tested');
     // Delete the users.
     user_delete_multiple($uids);
     // Test if the roles assignments are deleted.
diff --git a/core/modules/user/tests/src/Functional/UserMailNotifyTest.php b/core/modules/user/tests/src/Functional/UserMailNotifyTest.php
index 57bebc0..d8a4714 100644
--- a/core/modules/user/tests/src/Functional/UserMailNotifyTest.php
+++ b/core/modules/user/tests/src/Functional/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().');
   }
 
diff --git a/core/modules/user/tests/src/Functional/UserSaveTest.php b/core/modules/user/tests/src/Functional/UserSaveTest.php
index c693b39..01c482f 100644
--- a/core/modules/user/tests/src/Functional/UserSaveTest.php
+++ b/core/modules/user/tests/src/Functional/UserSaveTest.php
@@ -39,10 +39,10 @@ public function testUserImport() {
 
     // Test if created user exists.
     $user_by_uid = User::load($test_uid);
-    $this->assertTrue($user_by_uid, 'Loading user by uid.');
+    $this->assertNotEmpty($user_by_uid, 'Loading user by uid.');
 
     $user_by_name = user_load_by_name($test_name);
-    $this->assertTrue($user_by_name, 'Loading user by name.');
+    $this->assertNotEmpty($user_by_name, 'Loading user by name.');
   }
 
   /**
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureFileTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureFileTest.php
index 1d28e2a..eb9e299 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureFileTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureFileTest.php
@@ -46,7 +46,7 @@ public function testUserPictures() {
     $this->assertIdentical('image-test.png', $file->getFilename());
     $this->assertIdentical('public://image-test.png', $file->getFileUri());
     $this->assertIdentical('8', $file->getOwnerId());
-    $this->assertFalse($files);
+    $this->assertEmpty($files);
   }
 
 }
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php
index ed28777..805ec48 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php
@@ -141,7 +141,7 @@ public function testUser() {
       }
       else {
         // Ensure the user does not have a picture.
-        $this->assertFalse($user->user_picture->target_id, sprintf('User %s does not have a picture', $user->id()));
+        $this->assertEmpty($user->user_picture->target_id, sprintf('User %s does not have a picture', $user->id()));
       }
 
       // Use the API to check if the password has been salted and re-hashed to
diff --git a/core/modules/user/tests/src/Kernel/TempStoreDatabaseTest.php b/core/modules/user/tests/src/Kernel/TempStoreDatabaseTest.php
index b3d7ff1..0bc38ed 100644
--- a/core/modules/user/tests/src/Kernel/TempStoreDatabaseTest.php
+++ b/core/modules/user/tests/src/Kernel/TempStoreDatabaseTest.php
@@ -139,8 +139,8 @@ public function testUserTempStore() {
       ->condition('collection', "user.shared_tempstore.$collection")
       ->condition('name', $key)
       ->execute();
-    $this->assertFalse($stores[0]->get($key));
-    $this->assertFalse($stores[1]->get($key));
+    $this->assertEmpty($stores[0]->get($key));
+    $this->assertEmpty($stores[1]->get($key));
   }
 
 }
diff --git a/core/modules/user/tests/src/Traits/UserCreationTrait.php b/core/modules/user/tests/src/Traits/UserCreationTrait.php
index ccccfa7..845cb8a 100644
--- a/core/modules/user/tests/src/Traits/UserCreationTrait.php
+++ b/core/modules/user/tests/src/Traits/UserCreationTrait.php
@@ -69,7 +69,7 @@ protected function createUser(array $permissions = [], $name = NULL, $admin = FA
     $account = User::create($edit);
     $account->save();
 
-    $this->assertTrue($account->id(), SafeMarkup::format('User created with name %name and pass %pass', ['%name' => $edit['name'], '%pass' => $edit['pass']]), 'User login');
+    $this->assertNotNull($account->id(), SafeMarkup::format('User created with name %name and pass %pass', ['%name' => $edit['name'], '%pass' => $edit['pass']]), 'User login');
     if (!$account->id()) {
       return FALSE;
     }
diff --git a/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php b/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php
index b01e985..d7033c4 100644
--- a/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php
+++ b/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php
@@ -67,7 +67,7 @@ protected function assertViewsCacheTags(ViewExecutable $view, $expected_results_
       $view->build();
       $results_cache_item = \Drupal::cache('data')->get($cache_plugin->generateResultsKey());
       if (is_array($expected_results_cache)) {
-        $this->assertTrue($results_cache_item, 'Results cache item found.');
+        $this->assertNotEmpty($results_cache_item, 'Results cache item found.');
         if ($results_cache_item) {
           sort($expected_results_cache);
           $this->assertEqual($results_cache_item->tags, $expected_results_cache);
@@ -75,7 +75,7 @@ protected function assertViewsCacheTags(ViewExecutable $view, $expected_results_
         }
       }
       else {
-        $this->assertFalse($results_cache_item, 'Results cache item not found.');
+        $this->assertNull($results_cache_item, 'Results cache item not found.');
       }
 
       $this->pass('Checking Views render cache item cache tags.');
@@ -85,14 +85,14 @@ protected function assertViewsCacheTags(ViewExecutable $view, $expected_results_
 
       $render_cache_item = $render_cache->get($original);
       if ($views_caching_is_enabled === TRUE) {
-        $this->assertTrue(!empty($render_cache_item), 'Render cache item found.');
+        $this->assertNotEmpty($render_cache_item, 'Render cache item found.');
         if ($render_cache_item) {
           $this->assertEqual($render_cache_item['#cache']['tags'], $expected_render_array_cache_tags);
           $this->debugCacheTags($render_cache_item['#cache']['tags'], $expected_render_array_cache_tags);
         }
       }
       else {
-        $this->assertFalse($render_cache_item, 'Render cache item not found.');
+        $this->assertNull($render_cache_item, 'Render cache item not found.');
       }
     }
 
diff --git a/core/modules/views/tests/src/Functional/Entity/LatestRevisionFilterTest.php b/core/modules/views/tests/src/Functional/Entity/LatestRevisionFilterTest.php
index d73a117..b372469 100644
--- a/core/modules/views/tests/src/Functional/Entity/LatestRevisionFilterTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/LatestRevisionFilterTest.php
@@ -154,7 +154,7 @@ protected function assertNotInResultSet(ViewExecutable $view, array $not_expecte
     $found_revision_ids = array_filter($view->result, function ($row) use ($not_expected_revision_ids) {
       return in_array($row->vid, $not_expected_revision_ids);
     });
-    $this->assertFalse($found_revision_ids, $message);
+    $this->assertEmpty($found_revision_ids, $message);
   }
 
 }
diff --git a/core/modules/views/tests/src/Functional/GlossaryTest.php b/core/modules/views/tests/src/Functional/GlossaryTest.php
index d67f70d..fd40f70 100644
--- a/core/modules/views/tests/src/Functional/GlossaryTest.php
+++ b/core/modules/views/tests/src/Functional/GlossaryTest.php
@@ -113,7 +113,7 @@ public function testGlossaryView() {
       // Get the summary link for a certain character. Filter by label and href
       // to ensure that both of them are correct.
       $result = $this->xpath('//a[contains(@href, :href) and normalize-space(text())=:label]/..', [':href' => $href, ':label' => $label]);
-      $this->assertTrue(count($result));
+      $this->assertNotEmpty(count($result));
       // The rendered output looks like "<a href=''>X</a> | (count)" so let's
       // figure out the int.
       $result_count = explode(' ', trim(str_replace(['|', '(', ')'], '', $result[0]->getText())))[1];
diff --git a/core/modules/views/tests/src/Functional/Handler/AreaTest.php b/core/modules/views/tests/src/Functional/Handler/AreaTest.php
index d631373..0ec27d6 100644
--- a/core/modules/views/tests/src/Functional/Handler/AreaTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/AreaTest.php
@@ -164,7 +164,7 @@ public function testRenderAreaToken() {
 
     // Test that the list is token present.
     $element = $this->xpath('//ul[@class="global-tokens"]');
-    $this->assertTrue($element, 'Token list found on the options form.');
+    $this->assertNotEmpty($element, 'Token list found on the options form.');
 
     $empty_handler = &$view->empty['test_example'];
 
diff --git a/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php b/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
index a3646f0..2b5dac2 100644
--- a/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
@@ -347,7 +347,7 @@ public function testAlterUrl() {
       return $id_field->theme($row);
     });
     $elements = $this->xpathContent($output, '//a[contains(@class, :class)]', [':class' => $class]);
-    $this->assertTrue($elements);
+    $this->assertNotEmpty($elements);
     // @fixme link_class, alt, rel cannot be unset, which should be fixed.
     $id_field->options['alter']['link_class'] = '';
 
@@ -357,7 +357,7 @@ public function testAlterUrl() {
       return $id_field->theme($row);
     });
     $elements = $this->xpathContent($output, '//a[contains(@title, :alt)]', [':alt' => $rel]);
-    $this->assertTrue($elements);
+    $this->assertNotEmpty($elements);
     $id_field->options['alter']['alt'] = '';
 
     // Tests the rel setting.
@@ -366,7 +366,7 @@ public function testAlterUrl() {
       return $id_field->theme($row);
     });
     $elements = $this->xpathContent($output, '//a[contains(@rel, :rel)]', [':rel' => $rel]);
-    $this->assertTrue($elements);
+    $this->assertNotEmpty($elements);
     $id_field->options['alter']['rel'] = '';
 
     // Tests the target setting.
@@ -375,7 +375,7 @@ public function testAlterUrl() {
       return $id_field->theme($row);
     });
     $elements = $this->xpathContent($output, '//a[contains(@target, :target)]', [':target' => $target]);
-    $this->assertTrue($elements);
+    $this->assertNotEmpty($elements);
     unset($id_field->options['alter']['target']);
   }
 
@@ -396,16 +396,16 @@ public function testFieldClasses() {
     $id_field->options['label'] = $this->randomMachineName();
     $output = $view->preview();
     $output = $renderer->renderRoot($output);
-    $this->assertFalse($this->xpathContent($output, '//div[contains(@class, :class)]', [':class' => 'field-content']));
-    $this->assertFalse($this->xpathContent($output, '//div[contains(@class, :class)]', [':class' => 'field__label']));
+    $this->assertEmpty($this->xpathContent($output, '//div[contains(@class, :class)]', [':class' => 'field-content']));
+    $this->assertEmpty($this->xpathContent($output, '//div[contains(@class, :class)]', [':class' => 'field__label']));
 
     $id_field->options['element_default_classes'] = TRUE;
     $output = $view->preview();
     $output = $renderer->renderRoot($output);
     // Per default the label and the element of the field are spans.
-    $this->assertTrue($this->xpathContent($output, '//span[contains(@class, :class)]', [':class' => 'field-content']));
-    $this->assertTrue($this->xpathContent($output, '//span[contains(@class, :class)]', [':class' => 'views-label']));
-    $this->assertTrue($this->xpathContent($output, '//div[contains(@class, :class)]', [':class' => 'views-field']));
+    $this->assertNotEmpty($this->xpathContent($output, '//span[contains(@class, :class)]', [':class' => 'field-content']));
+    $this->assertNotEmpty($this->xpathContent($output, '//span[contains(@class, :class)]', [':class' => 'views-label']));
+    $this->assertNotEmpty($this->xpathContent($output, '//div[contains(@class, :class)]', [':class' => 'views-field']));
 
     // Tests the element wrapper classes/element.
     $random_class = $this->randomMachineName();
@@ -418,14 +418,14 @@ public function testFieldClasses() {
       $id_field->options['element_wrapper_class'] = $random_class;
       $output = $view->preview();
       $output = $renderer->renderRoot($output);
-      $this->assertTrue($this->xpathContent($output, "//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
+      $this->assertNotEmpty($this->xpathContent($output, "//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
 
       // Set no custom css class.
       $id_field->options['element_wrapper_class'] = '';
       $output = $view->preview();
       $output = $renderer->renderRoot($output);
-      $this->assertFalse($this->xpathContent($output, "//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
-      $this->assertTrue($this->xpathContent($output, "//li[contains(@class, views-row)]/{$element_type}"));
+      $this->assertEmpty($this->xpathContent($output, "//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
+      $this->assertNotEmpty($this->xpathContent($output, "//li[contains(@class, views-row)]/{$element_type}"));
     }
 
     // Tests the label class/element.
@@ -438,14 +438,14 @@ public function testFieldClasses() {
       $id_field->options['element_label_class'] = $random_class;
       $output = $view->preview();
       $output = $renderer->renderRoot($output);
-      $this->assertTrue($this->xpathContent($output, "//li[contains(@class, views-row)]//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
+      $this->assertNotEmpty($this->xpathContent($output, "//li[contains(@class, views-row)]//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
 
       // Set no custom css class.
       $id_field->options['element_label_class'] = '';
       $output = $view->preview();
       $output = $renderer->renderRoot($output);
-      $this->assertFalse($this->xpathContent($output, "//li[contains(@class, views-row)]//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
-      $this->assertTrue($this->xpathContent($output, "//li[contains(@class, views-row)]//{$element_type}"));
+      $this->assertEmpty($this->xpathContent($output, "//li[contains(@class, views-row)]//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
+      $this->assertNotEmpty($this->xpathContent($output, "//li[contains(@class, views-row)]//{$element_type}"));
     }
 
     // Tests the element classes/element.
@@ -458,14 +458,14 @@ public function testFieldClasses() {
       $id_field->options['element_class'] = $random_class;
       $output = $view->preview();
       $output = $renderer->renderRoot($output);
-      $this->assertTrue($this->xpathContent($output, "//li[contains(@class, views-row)]//div[contains(@class, views-field)]//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
+      $this->assertNotEmpty($this->xpathContent($output, "//li[contains(@class, views-row)]//div[contains(@class, views-field)]//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
 
       // Set no custom css class.
       $id_field->options['element_class'] = '';
       $output = $view->preview();
       $output = $renderer->renderRoot($output);
-      $this->assertFalse($this->xpathContent($output, "//li[contains(@class, views-row)]//div[contains(@class, views-field)]//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
-      $this->assertTrue($this->xpathContent($output, "//li[contains(@class, views-row)]//div[contains(@class, views-field)]//{$element_type}"));
+      $this->assertEmpty($this->xpathContent($output, "//li[contains(@class, views-row)]//div[contains(@class, views-field)]//{$element_type}[contains(@class, :class)]", [':class' => $random_class]));
+      $this->assertNotEmpty($this->xpathContent($output, "//li[contains(@class, views-row)]//div[contains(@class, views-field)]//{$element_type}"));
     }
 
     // Tests the available html elements.
@@ -630,14 +630,14 @@ public function testTextRendering() {
       return $name_field->advancedRender($row);
     });
     $this->assertSubString($output, $more_text, 'Make sure a read more text is displayed if the output got trimmed');
-    $this->assertTrue($this->xpathContent($output, '//a[contains(@href, :path)]', [':path' => $more_path]), 'Make sure the read more link points to the right destination.');
+    $this->assertNotEmpty($this->xpathContent($output, '//a[contains(@href, :path)]', [':path' => $more_path]), 'Make sure the read more link points to the right destination.');
 
     $name_field->options['alter']['more_link'] = FALSE;
     $output = $renderer->executeInRenderContext(new RenderContext(), function () use ($name_field, $row) {
       return $name_field->advancedRender($row);
     });
     $this->assertNotSubString($output, $more_text, 'Make sure no read more text appears.');
-    $this->assertFalse($this->xpathContent($output, '//a[contains(@href, :path)]', [':path' => $more_path]), 'Make sure no read more link appears.');
+    $this->assertEmpty($this->xpathContent($output, '//a[contains(@href, :path)]', [':path' => $more_path]), 'Make sure no read more link appears.');
 
     // Check for the ellipses.
     $row->views_test_data_name = $this->randomMachineName(8);
diff --git a/core/modules/views/tests/src/Functional/Handler/HandlerTest.php b/core/modules/views/tests/src/Functional/Handler/HandlerTest.php
index cffe6d1..132f658 100644
--- a/core/modules/views/tests/src/Functional/Handler/HandlerTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/HandlerTest.php
@@ -305,15 +305,15 @@ public function testSetRelationship() {
 
     $field->options['relationship'] = NULL;
     $field->setRelationship();
-    $this->assertFalse($field->relationship, 'Make sure that an empty relationship does not create a relationship on the field.');
+    $this->assertNull($field->relationship, 'Make sure that an empty relationship does not create a relationship on the field.');
 
     $field->options['relationship'] = $this->randomMachineName();
     $field->setRelationship();
-    $this->assertFalse($field->relationship, 'Make sure that a random relationship does not create a relationship on the field.');
+    $this->assertNull($field->relationship, 'Make sure that a random relationship does not create a relationship on the field.');
 
     $field->options['relationship'] = 'broken_relationship';
     $field->setRelationship();
-    $this->assertFalse($field->relationship, 'Make sure that a broken relationship does not create a relationship on the field.');
+    $this->assertNull($field->relationship, 'Make sure that a broken relationship does not create a relationship on the field.');
 
     $field->options['relationship'] = 'valid_relationship';
     $field->setRelationship();
diff --git a/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php b/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
index b3956de..4a3a11b 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
@@ -162,9 +162,9 @@ public function testArgumentDefaultNode() {
     $this->drupalPlaceBlock("views_block:test_argument_default_node-block_1", ['id' => $id]);
     $xpath = '//*[@id="block-' . $id . '"]';
     $this->drupalGet('node/' . $node1->id());
-    $this->assertTrue(strpos($this->xpath($xpath)[0]->getText(), $node1->getTitle()));
+    $this->assertNotEmpty(strpos($this->xpath($xpath)[0]->getText(), $node1->getTitle()));
     $this->drupalGet('node/' . $node2->id());
-    $this->assertTrue(strpos($this->xpath($xpath)[0]->getText(), $node2->getTitle()));
+    $this->assertNotEmpty(strpos($this->xpath($xpath)[0]->getText(), $node2->getTitle()));
   }
 
   /**
diff --git a/core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php b/core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php
index 1d78204..257f40f 100644
--- a/core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php
@@ -124,7 +124,7 @@ public function testTagCaching() {
     // Saving the view should invalidate the tags.
     $cache_plugin = $view->display_handler->getPlugin('cache');
     $this->assertTrue($cache_plugin->cacheGet('results'), 'Results cache found.');
-    $this->assertTrue($this->getRenderCache($view), 'Output cache found.');
+    $this->assertNotEmpty($this->getRenderCache($view), 'Output cache found.');
 
     $view->storage->save();
 
@@ -138,7 +138,7 @@ public function testTagCaching() {
     // Test invalidating the nodes in this view invalidates the cache.
     $cache_plugin = $view->display_handler->getPlugin('cache');
     $this->assertTrue($cache_plugin->cacheGet('results'), 'Results cache found.');
-    $this->assertTrue($this->getRenderCache($view), 'Output cache found.');
+    $this->assertNotEmpty($this->getRenderCache($view), 'Output cache found.');
 
     $this->nodeViewBuilder->resetCache($this->pages);
 
@@ -152,7 +152,7 @@ public function testTagCaching() {
     // Test saving a node in this view invalidates the cache.
     $cache_plugin = $view->display_handler->getPlugin('cache');
     $this->assertTrue($cache_plugin->cacheGet('results'), 'Results cache found.');
-    $this->assertTrue($this->getRenderCache($view), 'Output cache found.');
+    $this->assertNotEmpty($this->getRenderCache($view), 'Output cache found.');
 
     $node = reset($this->pages);
     $node->save();
@@ -167,7 +167,7 @@ public function testTagCaching() {
     // Test saving a node not in this view invalidates the cache too.
     $cache_plugin = $view->display_handler->getPlugin('cache');
     $this->assertTrue($cache_plugin->cacheGet('results'), 'Results cache found.');
-    $this->assertTrue($this->getRenderCache($view), 'Output cache found.');
+    $this->assertNotEmpty($this->getRenderCache($view), 'Output cache found.');
 
     $this->article->save();
 
@@ -182,13 +182,13 @@ public function testTagCaching() {
     // as the user entity type will not be contained in the views cache tags.
     $cache_plugin = $view->display_handler->getPlugin('cache');
     $this->assertTrue($cache_plugin->cacheGet('results'), 'Results cache found.');
-    $this->assertTrue($this->getRenderCache($view), 'Output cache found.');
+    $this->assertNotEmpty($this->getRenderCache($view), 'Output cache found.');
 
     $this->userViewBuilder->resetCache([$this->user]);
 
     $cache_plugin = $view->display_handler->getPlugin('cache');
     $this->assertTrue($cache_plugin->cacheGet('results'), 'Results cache found after a user is invalidated.');
-    $this->assertTrue($this->getRenderCache($view), 'Output cache found after a user is invalidated.');
+    $this->assertNotEmpty($this->getRenderCache($view), 'Output cache found after a user is invalidated.');
 
     $view->destroy();
     // Invalidate the views cache tags in order to invalidate the render
@@ -200,7 +200,7 @@ public function testTagCaching() {
     // Test the cacheFlush method invalidates the cache.
     $cache_plugin = $view->display_handler->getPlugin('cache');
     $this->assertTrue($cache_plugin->cacheGet('results'), 'Results cache found.');
-    $this->assertTrue($this->getRenderCache($view), 'Output cache found.');
+    $this->assertNotEmpty($this->getRenderCache($view), 'Output cache found.');
 
     $cache_plugin->cacheFlush();
 
diff --git a/core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php b/core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php
index f8ce5a9..8053f22 100644
--- a/core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php
@@ -65,7 +65,7 @@ public function testCacheOutputOnPage() {
 
     $this->drupalGet('test-display');
     $this->assertResponse(200);
-    $this->assertTrue($render_cache->get($cache_element));
+    $this->assertNotEmpty($render_cache->get($cache_element));
     $cache_tags = [
       'config:user.role.anonymous',
       'config:views.view.test_display',
@@ -76,7 +76,7 @@ public function testCacheOutputOnPage() {
 
     $this->drupalGet('test-display');
     $this->assertResponse(200);
-    $this->assertTrue($render_cache->get($cache_element));
+    $this->assertNotEmpty($render_cache->get($cache_element));
     $this->assertCacheTags($cache_tags);
   }
 
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
index 501d922..22c3507 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
@@ -135,7 +135,7 @@ public function testTitleOutput() {
 
     $view = Views::getView('test_page_display');
     $xpath = $this->cssSelect('div.view:contains("' . $view->getTitle() . '")');
-    $this->assertFalse($xpath, 'The view title was not displayed in the view markup.');
+    $this->assertEmpty($xpath, 'The view title was not displayed in the view markup.');
   }
 
   /**
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
index 6748152..cbe2033 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
@@ -289,7 +289,7 @@ public function testOutputIsEmpty() {
     ];
     $view->setHandler('default', 'filter', 'id', $item);
     $this->executeView($view);
-    $this->assertFalse(count($view->result), 'Ensure the result of the view is empty.');
+    $this->assertEmpty(count($view->result), 'Ensure the result of the view is empty.');
     $this->assertFalse($view->display_handler->outputIsEmpty(), 'Ensure the view output is marked as not empty, because the empty text still appears.');
     $view->destroy();
 
@@ -299,7 +299,7 @@ public function testOutputIsEmpty() {
     $item['empty'] = TRUE;
     $view->setHandler('default', 'header', 'area', $item);
     $this->executeView($view);
-    $this->assertFalse(count($view->result), 'Ensure the result of the view is empty.');
+    $this->assertEmpty(count($view->result), 'Ensure the result of the view is empty.');
     $this->assertFalse($view->display_handler->outputIsEmpty(), 'Ensure the view output is marked as not empty, because the header text still appears.');
     $view->destroy();
 
@@ -308,7 +308,7 @@ public function testOutputIsEmpty() {
     $item['empty'] = FALSE;
     $view->setHandler('default', 'header', 'area', $item);
     $this->executeView($view);
-    $this->assertFalse(count($view->result), 'Ensure the result of the view is empty.');
+    $this->assertEmpty(count($view->result), 'Ensure the result of the view is empty.');
     $this->assertTrue($view->display_handler->outputIsEmpty(), 'Ensure the view output is marked as empty.');
   }
 
diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
index 220dc24..98643f9 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
@@ -346,14 +346,14 @@ public function testFormErrorWithExposedForm() {
     $this->drupalGet('views_test_data_error_form_page');
     $this->assertResponse(200);
     $form = $this->cssSelect('form.views-exposed-form');
-    $this->assertTrue($form, 'The exposed form element was found.');
+    $this->assertNotEmpty($form, 'The exposed form element was found.');
     $this->assertRaw(t('Apply'), 'Ensure the exposed form is rendered before submitting the normal form.');
     $this->assertRaw('<div class="views-row">', 'Views result shown.');
 
     $this->drupalPostForm(NULL, [], t('Submit'));
     $this->assertResponse(200);
     $form = $this->cssSelect('form.views-exposed-form');
-    $this->assertTrue($form, 'The exposed form element was found.');
+    $this->assertNotEmpty($form, 'The exposed form element was found.');
     $this->assertRaw(t('Apply'), 'Ensure the exposed form is rendered after submitting the normal form.');
     $this->assertRaw('<div class="views-row">', 'Views result shown.');
   }
diff --git a/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php b/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
index 3bbe6bf..d1e756f 100644
--- a/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
@@ -35,15 +35,15 @@ public function testAccessibilitySettings() {
     $this->drupalGet('test-table');
 
     $result = $this->xpath('//caption/child::text()');
-    $this->assertTrue(count($result), 'The caption appears on the table.');
+    $this->assertNotEmpty(count($result), 'The caption appears on the table.');
     $this->assertEqual(trim($result[0]->getText()), 'caption-text');
 
     $result = $this->xpath('//summary/child::text()');
-    $this->assertTrue(count($result), 'The summary appears on the table.');
+    $this->assertNotEmpty(count($result), 'The summary appears on the table.');
     $this->assertEqual(trim($result[0]->getText()), 'summary-text');
 
     $result = $this->xpath('//caption/details/child::text()');
-    $this->assertTrue(count($result), 'The table description appears on the table.');
+    $this->assertNotEmpty(count($result), 'The table description appears on the table.');
     $this->assertEqual(trim($result[0]->getText()), 'description-text');
 
     // Remove the caption and ensure the caption is not displayed anymore.
@@ -54,7 +54,7 @@ public function testAccessibilitySettings() {
 
     $this->drupalGet('test-table');
     $result = $this->xpath('//caption/child::text()');
-    $this->assertFalse(trim($result[0]->getText()), 'Ensure that the caption disappears.');
+    $this->assertEmpty(trim($result[0]->getText()), 'Ensure that the caption disappears.');
 
     // Remove the table summary.
     $display = &$view->getDisplay('default');
@@ -63,7 +63,7 @@ public function testAccessibilitySettings() {
 
     $this->drupalGet('test-table');
     $result = $this->xpath('//summary/child::text()');
-    $this->assertFalse(count($result), 'Ensure that the summary disappears.');
+    $this->assertEmpty(count($result), 'Ensure that the summary disappears.');
 
     // Remove the table description.
     $display = &$view->getDisplay('default');
@@ -72,7 +72,7 @@ public function testAccessibilitySettings() {
 
     $this->drupalGet('test-table');
     $result = $this->xpath('//caption/details/child::text()');
-    $this->assertFalse(count($result), 'Ensure that the description disappears.');
+    $this->assertEmpty(count($result), 'Ensure that the description disappears.');
   }
 
   /**
@@ -86,9 +86,9 @@ public function testFieldInColumns() {
     // do: "views-field-job-1" would also contain "views-field-job".
     // @see Drupal\system\Tests\Form\ElementTest::testButtonClasses().
     $result = $this->xpath('//tbody/tr/td[contains(concat(" ", @class, " "), " views-field-job ")]');
-    $this->assertTrue(count($result), 'Ensure there is a td with the class views-field-job');
+    $this->assertNotEmpty(count($result), 'Ensure there is a td with the class views-field-job');
     $result = $this->xpath('//tbody/tr/td[contains(concat(" ", @class, " "), " views-field-job-1 ")]');
-    $this->assertTrue(count($result), 'Ensure there is a td with the class views-field-job-1');
+    $this->assertNotEmpty(count($result), 'Ensure there is a td with the class views-field-job-1');
 
     // Combine the second job-column with the first one, with ', ' as separator.
     $view = View::load('test_table');
@@ -101,10 +101,10 @@ public function testFieldInColumns() {
     $this->drupalGet('test-table');
 
     $result = $this->xpath('//tbody/tr/td[contains(concat(" ", @class, " "), " views-field-job views-field-job-1 ")]');
-    $this->assertTrue(count($result), 'Ensure that the job column class names are joined into a single column');
+    $this->assertNotEmpty(count($result), 'Ensure that the job column class names are joined into a single column');
 
     $result = $this->xpath('//tbody/tr/td[contains(., "Drummer, Drummer")]');
-    $this->assertTrue(count($result), 'Ensure the job column values are joined into a single column');
+    $this->assertNotEmpty(count($result), 'Ensure the job column values are joined into a single column');
   }
 
   /**
@@ -128,10 +128,10 @@ public function testNumericFieldVisible() {
     $this->drupalGet('test-table');
 
     $result = $this->xpath('//tbody/tr/td[contains(., "Baby")]');
-    $this->assertTrue(count($result), 'Ensure that the baby is found.');
+    $this->assertNotEmpty(count($result), 'Ensure that the baby is found.');
 
     $result = $this->xpath('//tbody/tr/td[text()=0]');
-    $this->assertTrue(count($result), 'Ensure that the baby\'s age is shown');
+    $this->assertNotEmpty(count($result), 'Ensure that the baby\'s age is shown');
   }
 
   /**
diff --git a/core/modules/views/tests/src/Functional/ViewElementTest.php b/core/modules/views/tests/src/Functional/ViewElementTest.php
index 2dbc54f..1fd45b9 100644
--- a/core/modules/views/tests/src/Functional/ViewElementTest.php
+++ b/core/modules/views/tests/src/Functional/ViewElementTest.php
@@ -37,10 +37,10 @@ public function testViewElement() {
     $this->drupalGet('views_test_data_element_form');
 
     $xpath = $this->xpath('//div[@class="views-element-container js-form-wrapper form-wrapper"]');
-    $this->assertTrue($xpath, 'The view container has been found on the form.');
+    $this->assertNotEmpty($xpath, 'The view container has been found on the form.');
 
     $xpath = $this->xpath('//div[@class="view-content"]');
-    $this->assertTrue($xpath, 'The view content has been found on the form.');
+    $this->assertNotEmpty($xpath, 'The view content has been found on the form.');
     // There should be 5 rows in the results.
     $xpath = $this->xpath('//div[@class="view-content"]/div');
     $this->assertEqual(count($xpath), 5);
@@ -82,10 +82,10 @@ public function testViewElementEmbed() {
     $this->drupalGet('views_test_data_element_embed_form');
 
     $xpath = $this->xpath('//div[@class="views-element-container js-form-wrapper form-wrapper"]');
-    $this->assertTrue($xpath, 'The view container has been found on the form.');
+    $this->assertNotEmpty($xpath, 'The view container has been found on the form.');
 
     $xpath = $this->xpath('//div[@class="view-content"]');
-    $this->assertTrue($xpath, 'The view content has been found on the form.');
+    $this->assertNotEmpty($xpath, 'The view content has been found on the form.');
     // There should be 5 rows in the results.
     $xpath = $this->xpath('//div[@class="view-content"]/div');
     $this->assertEqual(count($xpath), 5);
diff --git a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php
index 9a9b2da..3b7dad8 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php
@@ -85,21 +85,21 @@ public function testGroupedFilterValuesUI() {
     $weight = $page->findField('options[group_info][group_items][1][weight]');
 
     // If there are 3 items, values from -3 to 3 should be available.
-    $this->assertFalse($weight->find('named', ['option', -4]));
+    $this->assertNull($weight->find('named', ['option', -4]));
     foreach (range(-3, 3) as $value) {
-      $this->assertTrue($weight->find('named', ['option', $value]));
+      $this->assertNotEmpty($weight->find('named', ['option', $value]));
     }
-    $this->assertFalse($weight->find('named', ['option', 4]));
+    $this->assertEmpty($weight->find('named', ['option', 4]));
 
     $page->pressButton("Add another item");
     $web_assert->waitForField('options[group_info][group_items][4][title]');
 
     // A new items was added, weight options should now be -4 to 4.
-    $this->assertFalse($weight->find('named', ['option', -5]));
+    $this->assertEmpty($weight->find('named', ['option', -5]));
     foreach (range(-4, 4) as $value) {
-      $this->assertTrue($weight->find('named', ['option', $value]));
+      $this->assertNotEmpty($weight->find('named', ['option', $value]));
     }
-    $this->assertFalse($weight->find('named', ['option', 5]));
+    $this->assertEmpty($weight->find('named', ['option', 5]));
   }
 
 }
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php
index 8c16b63..b84c718 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php
@@ -29,7 +29,7 @@ public function testTitleText() {
     $view->setDisplay('default');
     $this->executeView($view);
     $view->render();
-    $this->assertFalse($view->getTitle(), 'The title area does not override the title if the view is not empty.');
+    $this->assertEmpty($view->getTitle(), 'The title area does not override the title if the view is not empty.');
     $view->destroy();
 
     $view->setDisplay('default');
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php
index 599052d..b86e8e5 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php
@@ -86,7 +86,7 @@ public function testFieldCustomTokens() {
     $output = $renderer->renderRoot($preview);
 
     $expected_text = 'Amount of kittens: ' . $view->style_plugin->getField(0, 'age');
-    $this->assertTrue(strpos((string) $output, $expected_text), 'The views token has been successfully replaced.');
+    $this->assertNotEmpty(strpos((string) $output, $expected_text), 'The views token has been successfully replaced.');
   }
 
   /**
diff --git a/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php b/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php
index 9f6066e..c12f5ee 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php
@@ -341,7 +341,7 @@ public function testCacheData() {
 
     // Assert there are results, empty results would mean this test case would
     // pass otherwise.
-    $this->assertTrue(count($cache->data['result']), 'Results saved in cached data.');
+    $this->assertNotEmpty(count($cache->data['result']), 'Results saved in cached data.');
 
     // Assert each row doesn't contain '_entity' or '_relationship_entities'
     // items.
diff --git a/core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php b/core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php
index d08adaa..1c71acb 100644
--- 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.');
   }
 
 }
diff --git a/core/modules/views/tests/src/Kernel/Plugin/QueryTest.php b/core/modules/views/tests/src/Kernel/Plugin/QueryTest.php
index 02548b2..fa110d9 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/QueryTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/QueryTest.php
@@ -44,7 +44,7 @@ public function _testInitQuery() {
     $view->setDisplay();
 
     $view->initQuery();
-    $this->assertTrue($view->query instanceof QueryTestPlugin, 'Make sure the right query plugin got instantiated.');
+    $this->assertNotEmpty($view->query instanceof QueryTestPlugin, 'Make sure the right query plugin got instantiated.');
   }
 
   public function _testQueryExecute() {
@@ -55,7 +55,7 @@ public function _testQueryExecute() {
     $view->query->setAllItems($this->dataSet());
 
     $this->executeView($view);
-    $this->assertTrue($view->result, 'Make sure the view result got filled');
+    $this->assertNotEmpty($view->result, 'Make sure the view result got filled');
   }
 
   /**
@@ -68,7 +68,7 @@ protected function queryMethodsTests() {
     $view->setDisplay();
 
     $view->initQuery();
-    $this->assertFalse($view->query->getLimit(), 'Default to an empty limit.');
+    $this->assertNull($view->query->getLimit(), 'Default to an empty limit.');
     $rand_number = rand(5, 10);
     $view->query->setLimit($rand_number);
     $this->assertEqual($view->query->getLimit(), $rand_number, 'set_limit adapts the amount of items.');
diff --git a/core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php b/core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php
index 223963e..0a578fd 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php
@@ -196,7 +196,7 @@ protected function doTestRenderedOutput(AccountInterface $account, $check_cache
           ],
         ];
         $element = $render_cache->get($cache);
-        $this->assertTrue($element);
+        $this->assertNotEmpty($element);
       }
 
       $index++;
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
index 1495399..e7ca5fb 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
@@ -64,7 +64,7 @@ protected function assertGrid(ViewExecutable $view, $alignment, $columns) {
     $this->setRawContent($output);
     if (!in_array($alignment, $this->alignmentsTested)) {
       $result = $this->xpath('//div[contains(@class, "views-view-grid") and contains(@class, :alignment) and contains(@class, :columns)]', [':alignment' => $alignment, ':columns' => 'cols-' . $columns]);
-      $this->assertTrue(count($result), ucfirst($alignment) . " grid markup detected.");
+      $this->assertNotEmpty(count($result), ucfirst($alignment) . " grid markup detected.");
       $this->alignmentsTested[] = $alignment;
     }
     $width = '0';
@@ -77,15 +77,15 @@ protected function assertGrid(ViewExecutable $view, $alignment, $columns) {
     }
     // Ensure last column exists.
     $result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, :columns) and starts-with(@style, :width)]', [':columns' => 'col-' . $columns, ':width' => 'width: ' . $width]);
-    $this->assertTrue(count($result), ucfirst($alignment) . " $columns column grid: last column exists and automatic width calculated correctly.");
+    $this->assertNotEmpty(count($result), ucfirst($alignment) . " $columns column grid: last column exists and automatic width calculated correctly.");
     // Ensure no extra columns were generated.
     $result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, :columns)]', [':columns' => 'col-' . ($columns + 1)]);
-    $this->assertFalse(count($result), ucfirst($alignment) . " $columns column grid: no extraneous columns exist.");
+    $this->assertEmpty(count($result), ucfirst($alignment) . " $columns column grid: no extraneous columns exist.");
     // Ensure tokens are being replaced in custom row/column classes.
     $result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, "name-John")]');
-    $this->assertTrue(count($result), ucfirst($alignment) . " $columns column grid: Token replacement verified in custom column classes.");
+    $this->assertNotEmpty(count($result), ucfirst($alignment) . " $columns column grid: Token replacement verified in custom column classes.");
     $result = $this->xpath('//div[contains(@class, "views-row") and contains(@class, "age-25")]');
-    $this->assertTrue(count($result), ucfirst($alignment) . " $columns column grid: Token replacement verified in custom row classes.");
+    $this->assertNotEmpty(count($result), ucfirst($alignment) . " $columns column grid: Token replacement verified in custom row classes.");
   }
 
 }
diff --git a/core/modules/views/tests/src/Kernel/QueryGroupByTest.php b/core/modules/views/tests/src/Kernel/QueryGroupByTest.php
index e4a0884..afb602c 100644
--- a/core/modules/views/tests/src/Kernel/QueryGroupByTest.php
+++ b/core/modules/views/tests/src/Kernel/QueryGroupByTest.php
@@ -187,8 +187,8 @@ public function testGroupByCountOnlyFilters() {
     $view = Views::getView('test_group_by_in_filters');
     $this->executeView($view);
 
-    $this->assertTrue(strpos($view->build_info['query'], 'GROUP BY'), 'Make sure that GROUP BY is in the query');
-    $this->assertTrue(strpos($view->build_info['query'], 'HAVING'), 'Make sure that HAVING is in the query');
+    $this->assertNotEmpty(strpos($view->build_info['query'], 'GROUP BY'), 'Make sure that GROUP BY is in the query');
+    $this->assertNotEmpty(strpos($view->build_info['query'], 'HAVING'), 'Make sure that HAVING is in the query');
   }
 
   /**
@@ -204,7 +204,7 @@ public function testGroupByBaseField() {
     $view->displayHandlers->get('default')->options['fields']['name']['group_type'] = 'min';
     unset($view->displayHandlers->get('default')->options['fields']['id']['group_type']);
     $this->executeView($view);
-    $this->assertTrue(strpos($view->build_info['query'], 'GROUP BY entity_test.id'), 'GROUP BY field includes the base table name when grouping on the base field.');
+    $this->assertNotEmpty(strpos($view->build_info['query'], 'GROUP BY entity_test.id'), 'GROUP BY field includes the base table name when grouping on the base field.');
   }
 
   /**
diff --git a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
index a2bec23..ba3769b 100644
--- a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
@@ -147,7 +147,7 @@ protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) {
     // @todo Static render arrays don't support different pages yet, see
     //   https://www.drupal.org/node/2500701.
     // $this->assertViewsCacheTagsFromStaticRenderArray($view, $tags_page_2, $do_assert_views_caches);
-    $this->assertTrue(strpos($build['#markup'], $random_name) !== FALSE);
+    $this->assertNotEmpty(strpos($build['#markup'], $random_name) !== FALSE);
     $view->destroy();
 
     $this->pass('Page 1');
@@ -157,7 +157,7 @@ protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) {
     $entities[1]->save();
     $build = $this->assertViewsCacheTags($view, $tags_page_1, $do_assert_views_caches, $tags_page_1);
     $this->assertViewsCacheTagsFromStaticRenderArray($view, $tags_page_1, $do_assert_views_caches);
-    $this->assertTrue(strpos($build['#markup'], $random_name) !== FALSE);
+    $this->assertNotEmpty(strpos($build['#markup'], $random_name) !== FALSE);
     $view->destroy();
 
     // Setup arguments to ensure that render caching also varies by them.
diff --git a/core/modules/views/tests/src/Kernel/ViewElementTest.php b/core/modules/views/tests/src/Kernel/ViewElementTest.php
index c6149e9..9d7d3eb 100644
--- a/core/modules/views/tests/src/Kernel/ViewElementTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewElementTest.php
@@ -33,7 +33,7 @@ public function testViewElement() {
     $this->setRawContent($renderer->renderRoot($render));
 
     $xpath = $this->xpath('//div[@class="views-element-container"]');
-    $this->assertTrue($xpath, 'The view container has been found in the rendered output.');
+    $this->assertNotEmpty($xpath, 'The view container has been found in the rendered output.');
 
     // There should be 5 rows in the results.
     $xpath = $this->xpath('//div[@class="views-row"]');
@@ -83,7 +83,7 @@ public function testViewElementEmbed() {
     $this->setRawContent($renderer->renderRoot($render));
 
     $xpath = $this->xpath('//div[@class="views-element-container"]');
-    $this->assertTrue($xpath, 'The view container has been found in the rendered output.');
+    $this->assertNotEmpty($xpath, 'The view container has been found in the rendered output.');
 
     // There should be 5 rows in the results.
     $xpath = $this->xpath('//div[@class="views-row"]');
diff --git a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
index b49d0c32..ce7fa5a 100644
--- a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
@@ -123,7 +123,7 @@ public function testInitMethods() {
       if ($type == 'relationship') {
         continue;
       }
-      $this->assertTrue(count($view->$type), format_string('Make sure a %type instance got instantiated.', ['%type' => $type]));
+      $this->assertNotEmpty(count($view->$type), format_string('Make sure a %type instance got instantiated.', ['%type' => $type]));
     }
 
     // initHandlers() should create display handlers automatically as well.
@@ -435,7 +435,7 @@ public function testValidate() {
       $match = function($value) use ($display) {
         return strpos($value, $display->display['display_title']) !== FALSE;
       };
-      $this->assertTrue(array_filter($validate[$id], $match), format_string('Error message found for @id display', ['@id' => $id]));
+      $this->assertNotEmpty(array_filter($validate[$id], $match), format_string('Error message found for @id display', ['@id' => $id]));
       $count++;
     }
 
diff --git a/core/modules/views/tests/src/Kernel/ViewStorageTest.php b/core/modules/views/tests/src/Kernel/ViewStorageTest.php
index 7cf953a..8332e9a 100644
--- a/core/modules/views/tests/src/Kernel/ViewStorageTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewStorageTest.php
@@ -107,7 +107,7 @@ protected function loadTests() {
 
     // Make sure that loaded default views get a UUID.
     $view = Views::getView('test_view_storage');
-    $this->assertTrue($view->storage->uuid());
+    $this->assertNotEmpty($view->storage->uuid());
   }
 
   /**
diff --git a/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php b/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
index 32d1ae9..be8710e 100644
--- a/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
+++ b/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
@@ -38,7 +38,7 @@ public function testAnalyzeBasic() {
 
     foreach (['ok', 'warning', 'error'] as $type) {
       $xpath = $this->xpath('//div[contains(@class, :class)]', [':class' => $type]);
-      $this->assertTrue(count($xpath), format_string('Analyse messages with @type found', ['@type' => $type]));
+      $this->assertNotEmpty(count($xpath), format_string('Analyse messages with @type found', ['@type' => $type]));
     }
 
     // This redirects the user back to the main views edit page.
diff --git a/core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php b/core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php
index 95f6d56..1746fdf 100644
--- a/core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php
+++ b/core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php
@@ -68,12 +68,12 @@ public function testCustomOption() {
       'plain' => [
         'true' => $custom_true,
         'false' => $custom_false,
-        'test' => 'assertTrue',
+        'test' => 'assertNotEmpty',
       ],
       'allowed tag' => [
         'true' => '<p>' . $custom_true . '</p>',
         'false' => '<p>' . $custom_false . '</p>',
-        'test' => 'assertTrue',
+        'test' => 'assertNotEmpty',
       ],
       'disallowed tag' => [
         'true' => '<script>' . $custom_true . '</script>',
@@ -140,12 +140,12 @@ public function testCustomOptionTemplate() {
       'plain' => [
         'true' => $custom_true,
         'false' => $custom_false,
-        'test' => 'assertTrue',
+        'test' => 'assertNotEmpty',
       ],
       'allowed tag' => [
         'true' => '<p>' . $custom_true . '</p>',
         'false' => '<p>' . $custom_false . '</p>',
-        'test' => 'assertTrue',
+        'test' => 'assertNotEmpty',
       ],
       'disallowed tag' => [
         'true' => '<script>' . $custom_true . '</script>',
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php b/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
index 1e53c71..ce2a52d 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
@@ -133,11 +133,11 @@ public function testDuplicateDisplay() {
     $view->initDisplay();
 
     $page_2 = $view->displayHandlers->get('page_2');
-    $this->assertTrue($page_2, 'The new page display got saved.');
+    $this->assertNotEmpty($page_2, 'The new page display got saved.');
     $this->assertEqual($page_2->display['display_title'], 'Page');
     $this->assertEqual($page_2->display['display_options']['path'], $path);
     $block_1 = $view->displayHandlers->get('block_1');
-    $this->assertTrue($block_1, 'The new block display got saved.');
+    $this->assertNotEmpty($block_1, 'The new block display got saved.');
     $this->assertEqual($block_1->display['display_plugin'], 'block');
     $this->assertEqual($block_1->display['display_title'], 'Block', 'The new display title got generated as expected.');
     $this->assertFalse(isset($block_1->display['display_options']['path']));
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayTest.php b/core/modules/views_ui/tests/src/Functional/DisplayTest.php
index 44724b4..50777e4 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayTest.php
@@ -50,9 +50,9 @@ public function testReorderDisplay() {
     $view = $this->randomView($view);
 
     $this->clickLink(t('Reorder displays'));
-    $this->assertTrue($this->xpath('//tr[@id="display-row-default"]'), 'Make sure the default display appears on the reorder listing');
-    $this->assertTrue($this->xpath('//tr[@id="display-row-page_1"]'), 'Make sure the page display appears on the reorder listing');
-    $this->assertTrue($this->xpath('//tr[@id="display-row-block_1"]'), 'Make sure the block display appears on the reorder listing');
+    $this->assertNotEmpty($this->xpath('//tr[@id="display-row-default"]'), 'Make sure the default display appears on the reorder listing');
+    $this->assertNotEmpty($this->xpath('//tr[@id="display-row-page_1"]'), 'Make sure the page display appears on the reorder listing');
+    $this->assertNotEmpty($this->xpath('//tr[@id="display-row-block_1"]'), 'Make sure the block display appears on the reorder listing');
 
     // Ensure the view displays are in the expected order in configuration.
     $expected_display_order = ['default', 'block_1', 'page_1'];
@@ -83,17 +83,17 @@ public function testDisableDisplay() {
     $path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
 
     $this->drupalGet($path_prefix);
-    $this->assertFalse($this->xpath('//div[contains(@class, :class)]', [':class' => 'views-display-disabled']), 'Make sure the disabled display css class does not appear after initial adding of a view.');
+    $this->assertEmpty($this->xpath('//div[contains(@class, :class)]', [':class' => 'views-display-disabled']), 'Make sure the disabled display css class does not appear after initial adding of a view.');
 
     $this->assertFieldById('edit-displays-settings-settings-content-tab-content-details-top-actions-disable', NULL, 'Make sure the disable button is visible.');
     $this->assertNoFieldById('edit-displays-settings-settings-content-tab-content-details-top-actions-enable', NULL, 'Make sure the enable button is not visible.');
     $this->drupalPostForm(NULL, [], 'Disable Page');
-    $this->assertTrue($this->xpath('//div[contains(@class, :class)]', [':class' => 'views-display-disabled']), 'Make sure the disabled display css class appears once the display is marked as such.');
+    $this->assertNotEmpty($this->xpath('//div[contains(@class, :class)]', [':class' => 'views-display-disabled']), 'Make sure the disabled display css class appears once the display is marked as such.');
 
     $this->assertNoFieldById('edit-displays-settings-settings-content-tab-content-details-top-actions-disable', NULL, 'Make sure the disable button is not visible.');
     $this->assertFieldById('edit-displays-settings-settings-content-tab-content-details-top-actions-enable', NULL, 'Make sure the enable button is visible.');
     $this->drupalPostForm(NULL, [], 'Enable Page');
-    $this->assertFalse($this->xpath('//div[contains(@class, :class)]', [':class' => 'views-display-disabled']), 'Make sure the disabled display css class does not appears once the display is enabled again.');
+    $this->assertEmpty($this->xpath('//div[contains(@class, :class)]', [':class' => 'views-display-disabled']), 'Make sure the disabled display css class does not appears once the display is enabled again.');
   }
 
   /**
@@ -187,14 +187,14 @@ public function testViewStatus() {
     // The view should initially have the enabled class on it's form wrapper.
     $this->drupalGet('admin/structure/views/view/' . $id);
     $elements = $this->xpath('//div[contains(@class, :edit) and contains(@class, :status)]', [':edit' => 'views-edit-view', ':status' => 'enabled']);
-    $this->assertTrue($elements, 'The enabled class was found on the form wrapper');
+    $this->assertNotEmpty($elements, 'The enabled class was found on the form wrapper');
 
     $view = Views::getView($id);
     $view->storage->disable()->save();
 
     $this->drupalGet('admin/structure/views/view/' . $id);
     $elements = $this->xpath('//div[contains(@class, :edit) and contains(@class, :status)]', [':edit' => 'views-edit-view', ':status' => 'disabled']);
-    $this->assertTrue($elements, 'The disabled class was found on the form wrapper.');
+    $this->assertNotEmpty($elements, 'The disabled class was found on the form wrapper.');
   }
 
   /**
diff --git a/core/modules/views_ui/tests/src/Functional/UITestBase.php b/core/modules/views_ui/tests/src/Functional/UITestBase.php
index 684b91f..247dc76 100644
--- a/core/modules/views_ui/tests/src/Functional/UITestBase.php
+++ b/core/modules/views_ui/tests/src/Functional/UITestBase.php
@@ -81,7 +81,7 @@ protected function drupalGet($path, array $options = [], array $headers = []) {
       $result = $this->drupalGet($url, $options);
       $this->assertSession()->statusCodeEquals(200);
       $this->assertEquals('application/json', $this->getSession()->getResponseHeader('Content-Type'));
-      $this->assertTrue(json_decode($result), 'Ensure that the AJAX request returned valid content.');
+      $this->assertNotEmpty(json_decode($result), 'Ensure that the AJAX request returned valid content.');
     }
 
     return parent::drupalGet($path, $options, $headers);
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
index 92b3a73..6d85cc4 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
@@ -126,8 +126,8 @@ public function testDetailsChildVisibility() {
     $summary = $page->find('css', '#edit-meta > summary');
 
     // Assert that both aria-expanded and aria-pressed are true.
-    $this->assertTrue($summary->getAttribute('aria-expanded'));
-    $this->assertTrue($summary->getAttribute('aria-pressed'));
+    $this->assertTrue($summary->getAttribute('aria-expanded') == 'true');
+    $this->assertTrue($summary->getAttribute('aria-pressed') == 'true');
   }
 
 }
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
index 20bf689..94a71d0 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -110,7 +110,7 @@ public function testForm() {
 
     // Test drupalPostForm() with no-html response.
     $values = Json::decode($this->drupalPostForm('form_test/form-state-values-clean', [], t('Submit')));
-    $this->assertTrue(1000, $values['beer']);
+    $this->assertNotEmpty(1000, $values['beer']);
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/AssertLegacyTrait.php b/core/tests/Drupal/KernelTests/AssertLegacyTrait.php
index f63c4bf..4820bbd 100644
--- a/core/tests/Drupal/KernelTests/AssertLegacyTrait.php
+++ b/core/tests/Drupal/KernelTests/AssertLegacyTrait.php
@@ -24,30 +24,6 @@ protected function assert($actual, $message = '') {
   }
 
   /**
-   * @see \Drupal\simpletest\TestBase::assertTrue()
-   */
-  public static function assertTrue($actual, $message = '') {
-    if (is_bool($actual)) {
-      parent::assertTrue($actual, $message);
-    }
-    else {
-      parent::assertNotEmpty($actual, $message);
-    }
-  }
-
-  /**
-   * @see \Drupal\simpletest\TestBase::assertFalse()
-   */
-  public static function assertFalse($actual, $message = '') {
-    if (is_bool($actual)) {
-      parent::assertFalse($actual, $message);
-    }
-    else {
-      parent::assertEmpty($actual, $message);
-    }
-  }
-
-  /**
    * @see \Drupal\simpletest\TestBase::assertEqual()
    *
    * @deprecated Scheduled for removal in Drupal 9.0.0. Use self::assertEquals()
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
index 13af30f..326a867 100644
--- a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
@@ -419,7 +419,7 @@ public function testLibraryAlter() {
     $js = $this->assetResolver->getJsAssets($assets, FALSE)[1];
     $js_render_array = \Drupal::service('asset.js.collection_renderer')->render($js);
     $rendered_js = $this->renderer->renderPlain($js_render_array);
-    $this->assertTrue(strpos($rendered_js, 'core/assets/vendor/jquery-form/jquery.form.min.js'), 'Altered library dependencies are added to the page.');
+    $this->assertNotFalse(strpos($rendered_js, 'core/assets/vendor/jquery-form/jquery.form.min.js'), 'Altered library dependencies are added to the page.');
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
index a77adfc..2b7a5ff 100644
--- a/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
@@ -37,7 +37,7 @@ public function testHookLibraryInfoByTheme() {
     // Activate test_theme and verify that the library 'kitten' is added using
     // hook_library_info_alter().
     $this->activateTheme('test_theme');
-    $this->assertTrue($this->libraryDiscovery->getLibraryByName('test_theme', 'kitten'));
+    $this->assertNotEmpty($this->libraryDiscovery->getLibraryByName('test_theme', 'kitten'));
 
     // Now make classy the active theme and assert that library is not added.
     $this->activateTheme('classy');
@@ -57,7 +57,7 @@ public function testLibrariesOverride() {
     $this->assertAssetInLibrary('core/themes/classy/css/components/dialog.css', 'classy', 'dialog', 'css');
 
     // Confirmatory assert on core library to be removed.
-    $this->assertTrue($this->libraryDiscovery->getLibraryByName('core', 'drupal.progress'), 'Confirmatory test on "core/drupal.progress"');
+    $this->assertNotEmpty($this->libraryDiscovery->getLibraryByName('core', 'drupal.progress'), 'Confirmatory test on "core/drupal.progress"');
 
     // Activate test theme that defines libraries overrides.
     $this->activateTheme('test_theme');
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
index 0fefc39..6d92d2f 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
@@ -40,7 +40,7 @@ public function testTagInvalidations() {
     foreach ($bins as $bin) {
       $bin = \Drupal::cache($bin);
       $bin->set('test', 'value', Cache::PERMANENT, $tags);
-      $this->assertTrue($bin->get('test'), 'Cache item was set in bin.');
+      $this->assertNotEmpty($bin->get('test'), 'Cache item was set in bin.');
     }
 
     $invalidations_before = intval(db_select('cachetags')->fields('cachetags', ['invalidations'])->condition('tag', 'test_tag:2')->execute()->fetchField());
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php b/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php
index a08d0f9..34b72d6 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php
@@ -465,7 +465,7 @@ public function testDeleteMultiple() {
     $this->assertSame(FALSE, $backend->get('test21'), "Cache id test21 does not exist.");
 
     // Calling deleteMultiple() with an empty array should not cause an error.
-    $this->assertFalse($backend->deleteMultiple([]));
+    $this->assertNull($backend->deleteMultiple([]));
   }
 
   /**
@@ -484,7 +484,7 @@ public function testDeleteAll() {
 
     $this->assertFalse($backend_a->get('test1'), 'First key has been deleted.');
     $this->assertFalse($backend_a->get('test2'), 'Second key has been deleted.');
-    $this->assertTrue($backend_b->get('test3'), 'Item in other bin is preserved.');
+    $this->assertNotEmpty($backend_b->get('test3'), 'Item in other bin is preserved.');
   }
 
   /**
@@ -517,7 +517,7 @@ public function testInvalidate() {
 
     // Calling invalidateMultiple() with an empty array should not cause an
     // error.
-    $this->assertFalse($backend->invalidateMultiple([]));
+    $this->assertNull($backend->invalidateMultiple([]));
   }
 
   /**
@@ -562,7 +562,7 @@ public function testInvalidateTags() {
     $bins = ['path', 'bootstrap', 'page'];
     foreach ($bins as $bin) {
       $this->getCacheBackend($bin)->set('test', $this->defaultValue, Cache::PERMANENT, $tags);
-      $this->assertTrue($this->getCacheBackend($bin)->get('test'), 'Cache item was set in bin.');
+      $this->assertNotEmpty($this->getCacheBackend($bin)->get('test'), 'Cache item was set in bin.');
     }
 
     Cache::invalidateTags(['test_tag:2']);
@@ -574,7 +574,7 @@ public function testInvalidateTags() {
     // Test that the cache entry with a matching tag has been invalidated.
     $this->assertFalse($this->getCacheBackend($bin)->get('test_cid_invalidate2'), 'Cache items matching tag were invalidated.');
     // Test that the cache entry with without a matching tag still exists.
-    $this->assertTrue($this->getCacheBackend($bin)->get('test_cid_invalidate1'), 'Cache items not matching tag were not invalidated.');
+    $this->assertNotEmpty($this->getCacheBackend($bin)->get('test_cid_invalidate1'), 'Cache items not matching tag were not invalidated.');
   }
 
   /**
@@ -593,9 +593,9 @@ public function testInvalidateAll() {
 
     $this->assertFalse($backend_a->get('test1'), 'First key has been invalidated.');
     $this->assertFalse($backend_a->get('test2'), 'Second key has been invalidated.');
-    $this->assertTrue($backend_b->get('test3'), 'Item in other bin is preserved.');
-    $this->assertTrue($backend_a->get('test1', TRUE), 'First key has not been deleted.');
-    $this->assertTrue($backend_a->get('test2', TRUE), 'Second key has not been deleted.');
+    $this->assertNotEmpty($backend_b->get('test3'), 'Item in other bin is preserved.');
+    $this->assertNotEmpty($backend_a->get('test1', TRUE), 'First key has not been deleted.');
+    $this->assertNotEmpty($backend_a->get('test2', TRUE), 'Second key has not been deleted.');
   }
 
   /**
@@ -614,7 +614,7 @@ public function testRemoveBin() {
 
     $this->assertFalse($backend_a->get('test1'), 'First key has been deleted.');
     $this->assertFalse($backend_a->get('test2', TRUE), 'Second key has been deleted.');
-    $this->assertTrue($backend_b->get('test3'), 'Item in other bin is preserved.');
+    $this->assertNotEmpty($backend_b->get('test3'), 'Item in other bin is preserved.');
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
index 17b6ae4..8622e0c 100644
--- a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
@@ -156,21 +156,21 @@ public function testDbDumpCommand() {
 
     // Tables that are schema-only should not have data exported.
     $pattern = preg_quote("\$connection->insert('sessions')");
-    $this->assertFalse(preg_match('/' . $pattern . '/', $command_tester->getDisplay()), 'Tables defined as schema-only do not have data exported to the script.');
+    $this->assertNotRegExp('/' . $pattern . '/', $command_tester->getDisplay(), 'Tables defined as schema-only do not have data exported to the script.');
 
     // Table data is exported.
     $pattern = preg_quote("\$connection->insert('config')");
-    $this->assertTrue(preg_match('/' . $pattern . '/', $command_tester->getDisplay()), 'Table data is properly exported to the script.');
+    $this->assertRegExp('/' . $pattern . '/', $command_tester->getDisplay(), 'Table data is properly exported to the script.');
 
     // The test data are in the dump (serialized).
     $pattern = preg_quote(serialize($this->data));
-    $this->assertTrue(preg_match('/' . $pattern . '/', $command_tester->getDisplay()), 'Generated data is found in the exported script.');
+    $this->assertRegExp('/' . $pattern . '/', $command_tester->getDisplay(), 'Generated data is found in the exported script.');
 
     // Check that the user account name and email address was properly escaped.
     $pattern = preg_quote('"q\'uote\$dollar@example.com"');
-    $this->assertTrue(preg_match('/' . $pattern . '/', $command_tester->getDisplay()), 'The user account email address was properly escaped in the exported script.');
+    $this->assertRegExp('/' . $pattern . '/', $command_tester->getDisplay(), 'The user account email address was properly escaped in the exported script.');
     $pattern = preg_quote('\'$dollar\'');
-    $this->assertTrue(preg_match('/' . $pattern . '/', $command_tester->getDisplay()), 'The user account name was properly escaped in the exported script.');
+    $this->assertRegExp('/' . $pattern . '/', $command_tester->getDisplay(), 'The user account name was properly escaped in the exported script.');
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php
index 7bc7fcc..c5545ec 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php
@@ -222,8 +222,8 @@ public function testConfigEntityUninstall() {
     // Test that doing a config uninstall of the node module deletes entity2
     // since it is dependent on entity1 which is dependent on the node module.
     $config_manager->uninstall('module', 'node');
-    $this->assertFalse($storage->load('entity1'), 'Entity 1 deleted');
-    $this->assertFalse($storage->load('entity2'), 'Entity 2 deleted');
+    $this->assertEmpty($storage->load('entity1'), 'Entity 1 deleted');
+    $this->assertEmpty($storage->load('entity2'), 'Entity 2 deleted');
   }
 
   /**
@@ -338,14 +338,14 @@ public function testConfigEntityUninstallComplex(array $entity_id_suffixes) {
     $config_manager->uninstall('module', 'node');
 
     // Test that expected actions have been performed.
-    $this->assertFalse($storage->load($entity_1->id()), 'Entity 1 deleted');
+    $this->assertNull($storage->load($entity_1->id()), 'Entity 1 deleted');
     $entity_2 = $storage->load($entity_2->id());
-    $this->assertTrue($entity_2, 'Entity 2 not deleted');
+    $this->assertNotEmpty($entity_2, 'Entity 2 not deleted');
     $this->assertEqual($entity_2->calculateDependencies()->getDependencies()['config'], [], 'Entity 2 dependencies updated to remove dependency on entity 1.');
     $entity_3 = $storage->load($entity_3->id());
-    $this->assertTrue($entity_3, 'Entity 3 not deleted');
+    $this->assertNotEmpty($entity_3, 'Entity 3 not deleted');
     $this->assertEqual($entity_3->calculateDependencies()->getDependencies()['config'], [$entity_2->getConfigDependencyName()], 'Entity 3 still depends on entity 2.');
-    $this->assertFalse($storage->load($entity_4->id()), 'Entity 4 deleted');
+    $this->assertNull($storage->load($entity_4->id()), 'Entity 4 deleted');
   }
 
   /**
@@ -453,16 +453,16 @@ public function testConfigEntityUninstallThirdParty() {
 
     // Test that expected actions have been performed.
     $entity_1 = $storage->load($entity_1->id());
-    $this->assertTrue($entity_1, 'Entity 1 not deleted');
+    $this->assertNotEmpty($entity_1, 'Entity 1 not deleted');
     $this->assertSame($entity_1->getThirdPartySettings('node'), [], 'Entity 1 third party settings updated.');
     $entity_2 = $storage->load($entity_2->id());
-    $this->assertTrue($entity_2, 'Entity 2 not deleted');
+    $this->assertNotEmpty($entity_2, 'Entity 2 not deleted');
     $this->assertSame($entity_2->getThirdPartySettings('node'), [], 'Entity 2 third party settings updated.');
     $this->assertSame($entity_2->calculateDependencies()->getDependencies()['config'], [$entity_1->getConfigDependencyName()], 'Entity 2 still depends on entity 1.');
     $entity_3 = $storage->load($entity_3->id());
-    $this->assertTrue($entity_3, 'Entity 3 not deleted');
+    $this->assertNotEmpty($entity_3, 'Entity 3 not deleted');
     $this->assertSame($entity_3->calculateDependencies()->getDependencies()['config'], [$entity_2->getConfigDependencyName()], 'Entity 3 still depends on entity 2.');
-    $this->assertFalse($storage->load($entity_4->id()), 'Entity 4 deleted');
+    $this->assertNull($storage->load($entity_4->id()), 'Entity 4 deleted');
   }
 
   /**
@@ -502,8 +502,8 @@ public function testConfigEntityDelete() {
     // Test that doing a delete of entity1 deletes entity2 since it is dependent
     // on entity1.
     $entity1->delete();
-    $this->assertFalse($storage->load('entity1'), 'Entity 1 deleted');
-    $this->assertFalse($storage->load('entity2'), 'Entity 2 deleted');
+    $this->assertEmpty($storage->load('entity1'), 'Entity 1 deleted');
+    $this->assertEmpty($storage->load('entity2'), 'Entity 2 deleted');
 
     // Set a more complicated test where dependencies will be fixed.
     \Drupal::state()->set('config_test.fix_dependencies', [$entity1->getConfigDependencyName()]);
@@ -556,12 +556,12 @@ public function testConfigEntityDelete() {
     $entity1->delete();
 
     // Test that expected actions have been performed.
-    $this->assertFalse($storage->load('entity1'), 'Entity 1 deleted');
+    $this->assertNull($storage->load('entity1'), 'Entity 1 deleted');
     $entity2 = $storage->load('entity2');
-    $this->assertTrue($entity2, 'Entity 2 not deleted');
+    $this->assertNotEmpty($entity2, 'Entity 2 not deleted');
     $this->assertEqual($entity2->calculateDependencies()->getDependencies()['config'], [], 'Entity 2 dependencies updated to remove dependency on Entity1.');
     $entity3 = $storage->load('entity3');
-    $this->assertTrue($entity3, 'Entity 3 not deleted');
+    $this->assertNotEmpty($entity3, 'Entity 3 not deleted');
     $this->assertEqual($entity3->calculateDependencies()->getDependencies()['config'], [$entity2->getConfigDependencyName()], 'Entity 3 still depends on Entity 2.');
   }
 
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php
index b449064..b6d27ca 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php
@@ -55,7 +55,7 @@ public function testReadWriteConfig() {
 
     // Verify a configuration object is returned.
     $this->assertEqual($config->getName(), $name);
-    $this->assertTrue($config, 'Config object created.');
+    $this->assertNotEmpty($config, 'Config object created.');
 
     // Verify the configuration object is empty.
     $this->assertEqual($config->get(), [], 'New config object is empty.');
@@ -92,12 +92,12 @@ public function testReadWriteConfig() {
 
     // Verify the database entry exists.
     $data = $storage->read($name);
-    $this->assertTrue($data);
+    $this->assertNotEmpty($data);
 
     // Read top level value.
     $config = $this->config($name);
     $this->assertEqual($config->getName(), $name);
-    $this->assertTrue($config, 'Config object created.');
+    $this->assertNotEmpty($config, 'Config object created.');
     $this->assertEqual($config->get($key), 'bar', 'Top level configuration value found.');
 
     // Read nested value.
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
index 9d3989c..b123c4e 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
@@ -364,7 +364,7 @@ public function testSecondaryUpdateDeletedDeleterFirst() {
 
     // The deletee was deleted in
     // \Drupal\config_test\Entity\ConfigTest::postSave().
-    $this->assertFalse($entity_storage->load('deletee'));
+    $this->assertEmpty($entity_storage->load('deletee'));
 
     $other = $entity_storage->load('other');
     $this->assertEqual($other->id(), 'other');
@@ -420,8 +420,8 @@ public function testSecondaryUpdateDeletedDeleteeFirst() {
     // Both entities are deleted. ConfigTest::postSave() causes updates of the
     // deleter entity to delete the deletee entity. Since the deleter depends on
     // the deletee, removing the deletee causes the deleter to be removed.
-    $this->assertFalse($entity_storage->load('deleter'));
-    $this->assertFalse($entity_storage->load('deletee'));
+    $this->assertEmpty($entity_storage->load('deleter'));
+    $this->assertEmpty($entity_storage->load('deletee'));
     $logs = $this->configImporter->getErrors();
     $this->assertEqual(count($logs), 0);
   }
@@ -459,8 +459,8 @@ public function testSecondaryDeletedDeleteeSecond() {
     $this->configImporter->reset()->import();
 
     $entity_storage = \Drupal::entityManager()->getStorage('config_test');
-    $this->assertFalse($entity_storage->load('deleter'));
-    $this->assertFalse($entity_storage->load('deletee'));
+    $this->assertEmpty($entity_storage->load('deleter'));
+    $this->assertEmpty($entity_storage->load('deletee'));
     // The deletee entity does not exist as the delete worked and although the
     // delete occurred in \Drupal\config_test\Entity\ConfigTest::postDelete()
     // this does not matter.
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php
index 9e473c2..71cdace 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php
@@ -224,7 +224,7 @@ public function testDependencyChecking() {
     $this->installModules(['config_other_module_config_test']);
     $this->installModules(['config_install_dependency_test']);
     $entity = \Drupal::entityManager()->getStorage('config_test')->load('other_module_test_with_dependency');
-    $this->assertTrue($entity, 'The config_test.dynamic.other_module_test_with_dependency configuration has been created during install.');
+    $this->assertNotEmpty($entity, 'The config_test.dynamic.other_module_test_with_dependency configuration has been created during install.');
     // Ensure that dependencies can be added during module installation by
     // hooks.
     $this->assertSame('config_install_dependency_test', $entity->getDependencies()['module'][0]);
diff --git a/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php b/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
index 04ba8ad..8e8c1dd 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
@@ -58,7 +58,7 @@ public function testArrayArgumentsSQLInjection() {
       ->countQuery()
       ->execute()
       ->fetchField();
-    $this->assertFalse($result, 'SQL injection attempt did not result in a row being inserted in the database table.');
+    $this->assertEmpty($result, 'SQL injection attempt did not result in a row being inserted in the database table.');
   }
 
   /**
@@ -89,7 +89,7 @@ public function testConditionOperatorArgumentsSQLInjection() {
       ->countQuery()
       ->execute()
       ->fetchField();
-    $this->assertFalse($result, 'SQL injection attempt did not result in a row being inserted in the database table.');
+    $this->assertEmpty($result, 'SQL injection attempt did not result in a row being inserted in the database table.');
 
     // Attempt SQLi via union query with no unsafe characters.
     $this->enableModules(['user']);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php
index 66e1abb..a81d70a 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php
@@ -203,7 +203,7 @@ public function testChanged() {
     $query = $this->mulChangedStorage->getQuery();
     $ids = $query->condition('changed', $changed_de, '=', 'en')->execute();
 
-    $this->assertFalse(
+    $this->assertEmpty(
       $ids,
       'There\'s no original entity stored having the changed time of the German translation.'
     );
@@ -219,7 +219,7 @@ public function testChanged() {
     $query = $this->mulChangedStorage->getQuery();
     $ids = $query->condition('changed', $changed_de)->condition('default_langcode', '1')->execute();
 
-    $this->assertFalse(
+    $this->assertEmpty(
       $ids,
       'There\'s no entity stored using the default language having the changed time of the German translation.'
     );
@@ -243,7 +243,7 @@ public function testChanged() {
     $query = $this->mulChangedStorage->getQuery();
     $ids = $query->condition('changed', $changed_en, '=', 'de')->execute();
 
-    $this->assertFalse(
+    $this->assertEmpty(
       $ids,
       'There\'s no German translation stored having the changed time of the original language.'
     );
@@ -275,7 +275,7 @@ public function testChanged() {
     $query = $this->mulChangedStorage->getQuery();
     $ids = $query->condition('changed', $changed_en, '>')->execute();
 
-    $this->assertFalse(
+    $this->assertEmpty(
       $ids,
       'Entity query can access changed time regardless of translation.'
     );
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
index 31b1f9e..feb2de1 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
@@ -616,12 +616,12 @@ public function getContainedStrings(TypedDataInterface $wrapper, $depth, array &
   public function testDataTypes() {
     $types = \Drupal::typedDataManager()->getDefinitions();
     foreach (entity_test_entity_types() as $entity_type) {
-      $this->assertTrue($types['entity:' . $entity_type]['class'], 'Entity data type registered.');
+      $this->assertNotEmpty($types['entity:' . $entity_type]['class'], 'Entity data type registered.');
     }
     // Check bundle types are provided as well.
     entity_test_create_bundle('bundle');
     $types = \Drupal::typedDataManager()->getDefinitions();
-    $this->assertTrue($types['entity:entity_test:bundle']['class'], 'Entity bundle data type registered.');
+    $this->assertNotEmpty($types['entity:entity_test:bundle']['class'], 'Entity bundle data type registered.');
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
index 0430369..43200c7 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
@@ -481,7 +481,7 @@ public function testCount() {
       ->exists("$field_name.color")
       ->count()
       ->execute();
-    $this->assertFalse($count);
+    $this->assertEquals(0, $count);
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
index bcd702a..af8a89e 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
@@ -51,7 +51,7 @@ protected function doTestEntityLanguageMethods($entity_type) {
       ]);
 
     $this->assertEqual($entity->language()->getId(), LanguageInterface::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Entity language not specified.', ['%entity_type' => $entity_type]));
-    $this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', ['%entity_type' => $entity_type]));
+    $this->assertEmpty($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', ['%entity_type' => $entity_type]));
 
     // Set the value in default language.
     $entity->set($this->fieldName, [0 => ['value' => 'default value']]);
@@ -76,7 +76,7 @@ protected function doTestEntityLanguageMethods($entity_type) {
     $entity->{$langcode_key}->value = $default_langcode;
     $entity->{$this->fieldName} = [];
     $this->assertEqual($entity->language(), \Drupal::languageManager()->getLanguage($this->langcodes[0]), format_string('%entity_type: Entity language retrieved.', ['%entity_type' => $entity_type]));
-    $this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', ['%entity_type' => $entity_type]));
+    $this->assertEmpty($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', ['%entity_type' => $entity_type]));
 
     // Set the value in default language.
     $entity->set($this->fieldName, [0 => ['value' => 'default value']]);
@@ -335,7 +335,7 @@ protected function doTestEntityTranslationAPI($entity_type) {
 
     $entity->save();
     $hooks = $this->getHooksInfo();
-    $this->assertFalse($hooks, 'No entity translation hooks are fired when creating an entity.');
+    $this->assertEmpty($hooks, 'No entity translation hooks are fired when creating an entity.');
 
     // Verify that we obtain the entity object itself when we attempt to
     // retrieve a translation referring to it.
@@ -507,7 +507,7 @@ protected function doTestEntityTranslationAPI($entity_type) {
     $this->assertTrue(isset($hooks[$entity_type . '_translation_create']), 'The entity-type-specific entity translation creation hook is run when adding and removing a translation without storing it.');
     unset($hooks[$entity_type . '_translation_create']);
 
-    $this->assertFalse($hooks, 'No other hooks beyond the entity translation creation hooks are run when adding and removing a translation without storing it.');
+    $this->assertEmpty($hooks, 'No other hooks beyond the entity translation creation hooks are run when adding and removing a translation without storing it.');
 
     // Check that hooks are fired only when actually storing data.
     $entity = $this->reloadEntity($entity);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
index a3466a4..51bf5ae 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
@@ -55,7 +55,7 @@ protected function assertCRUD($entity_type) {
       ->getStorage($entity_type)
       ->create(['name' => $this->randomMachineName()]);
     $uuid = $entity->uuid();
-    $this->assertTrue($uuid);
+    $this->assertNotEmpty($uuid);
 
     // Verify that the new UUID is different.
     $this->assertNotEqual($custom_entity->uuid(), $uuid);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
index e1537bc..13b711b 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
@@ -65,7 +65,7 @@ public function testEntityViewBuilderCache() {
 
     // Test that a cache entry is created.
     $renderer->renderRoot($build);
-    $this->assertTrue($this->container->get('cache.' . $bin)->get($cid), 'The entity render element has been cached.');
+    $this->assertNotEmpty($this->container->get('cache.' . $bin)->get($cid), 'The entity render element has been cached.');
 
     // Re-save the entity and check that the cache entry has been deleted.
     $cache->set('kittens', 'Kitten data', Cache::PERMANENT, $build['#cache']['tags']);
@@ -77,7 +77,7 @@ public function testEntityViewBuilderCache() {
     // delete the entity to check the cache entry is deleted.
     unset($build['#printed']);
     $renderer->renderRoot($build);
-    $this->assertTrue($this->container->get('cache.' . $bin)->get($cid), 'The entity render element has been cached.');
+    $this->assertNotEmpty($this->container->get('cache.' . $bin)->get($cid), 'The entity render element has been cached.');
     $entity_test->delete();
     $this->assertFalse($this->container->get('cache.' . $bin)->get($cid), 'The entity render cache has been cleared when the entity was deleted.');
 
@@ -119,7 +119,7 @@ public function testEntityViewBuilderCacheWithReferences() {
     $renderer->renderRoot($build);
 
     // Test that a cache entry was created for the referenced entity.
-    $this->assertTrue($this->container->get('cache.' . $bin_reference)->get($cid_reference), 'The entity render element for the referenced entity has been cached.');
+    $this->assertNotEmpty($this->container->get('cache.' . $bin_reference)->get($cid_reference), 'The entity render element for the referenced entity has been cached.');
 
     // Create another entity that references the first one.
     $entity_test = $this->createTestEntity('entity_test');
@@ -138,7 +138,7 @@ public function testEntityViewBuilderCacheWithReferences() {
     $renderer->renderRoot($build);
 
     // Test that a cache entry is created.
-    $this->assertTrue($this->container->get('cache.' . $bin)->get($cid), 'The entity render element has been cached.');
+    $this->assertNotEmpty($this->container->get('cache.' . $bin)->get($cid), 'The entity render element has been cached.');
 
     // Save the entity and verify that both cache entries have been deleted.
     $entity_test_reference->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
index a365ea5..25c8995 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
@@ -44,18 +44,18 @@ public function testValidation() {
 
     $typed_data = $this->typedData->create($definition, ['target_id' => $entity->id()]);
     $violations = $typed_data->validate();
-    $this->assertFalse($violations->count(), 'Validation passed for correct value.');
+    $this->assertEmpty($violations->count(), 'Validation passed for correct value.');
 
     // NULL is also considered a valid reference.
     $typed_data = $this->typedData->create($definition, ['target_id' => NULL]);
     $violations = $typed_data->validate();
-    $this->assertFalse($violations->count(), 'Validation passed for correct value.');
+    $this->assertEmpty($violations->count(), 'Validation passed for correct value.');
 
     $typed_data = $this->typedData->create($definition, ['target_id' => $entity->id()]);
     // Delete the referenced entity.
     $entity->delete();
     $violations = $typed_data->validate();
-    $this->assertTrue($violations->count(), 'Validation failed for incorrect value.');
+    $this->assertNotEmpty($violations->count(), 'Validation failed for incorrect value.');
 
     // Make sure the information provided by a violation is correct.
     $violation = $violations[0];
diff --git a/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php b/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
index 00dfa0b..fd2dfc1 100644
--- a/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
@@ -51,15 +51,15 @@ public function testReadOnlyBehavior() {
     $this->assertFalse($handle, 'Unable to open a file for reading and writing with the read-only stream wrapper.');
     // Attempt to open a file in binary read mode
     $handle = fopen($uri, 'rb');
-    $this->assertTrue($handle, 'Able to open a file for reading in binary mode with the read-only stream wrapper.');
+    $this->assertNotFalse($handle, 'Able to open a file for reading in binary mode with the read-only stream wrapper.');
     $this->assertTrue(fclose($handle), 'Able to close file opened in binary mode using the read_only stream wrapper.');
     // Attempt to open a file in text read mode
     $handle = fopen($uri, 'rt');
-    $this->assertTrue($handle, 'Able to open a file for reading in text mode with the read-only stream wrapper.');
+    $this->assertNotFalse($handle, 'Able to open a file for reading in text mode with the read-only stream wrapper.');
     $this->assertTrue(fclose($handle), 'Able to close file opened in text mode using the read_only stream wrapper.');
     // Attempt to open a file in read mode
     $handle = fopen($uri, 'r');
-    $this->assertTrue($handle, 'Able to open a file for reading with the read-only stream wrapper.');
+    $this->assertNotFalse($handle, 'Able to open a file for reading with the read-only stream wrapper.');
     // Attempt to change file permissions
     $this->assertFalse(@chmod($uri, 0777), 'Unable to change file permissions when using read-only stream wrapper.');
     // Attempt to acquire an exclusive lock for writing
@@ -71,7 +71,7 @@ public function testReadOnlyBehavior() {
     // Attempt to truncate the file
     $this->assertFalse(@ftruncate($handle, 0), 'Unable to truncate using the read-only stream wrapper.');
     // Attempt to write to the file
-    $this->assertFalse(@fwrite($handle, $this->randomMachineName()), 'Unable to write to file using the read-only stream wrapper.');
+    $this->assertEquals(0, @fwrite($handle, $this->randomMachineName()), 'Unable to write to file using the read-only stream wrapper.');
     // Attempt to flush output to the file
     $this->assertFalse(@fflush($handle), 'Unable to flush output to file using the read-only stream wrapper.');
     // Attempt to close the stream.  (Suppress errors, as fclose triggers fflush.)
diff --git a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
index 6c18b66..ac25549 100644
--- a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
@@ -81,8 +81,8 @@ public function testUriFunctions() {
     $this->assertEqual(file_uri_target('public://foo/bar.txt'), 'foo/bar.txt', 'Got a valid stream target from public://foo/bar.txt.');
     $this->assertEqual(file_uri_target('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='), 'image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', t('Got a valid stream target from a data URI.'));
     $this->assertFalse(file_uri_target('foo/bar.txt'), 'foo/bar.txt is not a valid stream.');
-    $this->assertFalse(file_uri_target('public://'), 'public:// has no target.');
-    $this->assertFalse(file_uri_target('data:'), 'data: has no target.');
+    $this->assertEquals('', file_uri_target('public://'), 'public:// has no target.');
+    $this->assertEquals('', file_uri_target('data:'), 'data: has no target.');
 
     // Test file_build_uri() and
     // Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath().
@@ -96,9 +96,9 @@ public function testUriFunctions() {
     // TemporaryStream::getExternalUrl() uses Url::fromRoute(), which needs
     // route information to work.
     $this->container->get('router.builder')->rebuild();
-    $this->assertTrue(strpos(file_create_url('temporary://test.txt'), 'system/temporary?file=test.txt'), 'Temporary external URL correctly built.');
-    $this->assertTrue(strpos(file_create_url('public://test.txt'), Settings::get('file_public_path') . '/test.txt'), 'Public external URL correctly built.');
-    $this->assertTrue(strpos(file_create_url('private://test.txt'), 'system/files/test.txt'), 'Private external URL correctly built.');
+    $this->assertContains('system/temporary?file=test.txt', file_create_url('temporary://test.txt'), 'Temporary external URL correctly built.');
+    $this->assertContains(Settings::get('file_public_path') . '/test.txt', file_create_url('public://test.txt'), 'Public external URL correctly built.');
+    $this->assertContains('system/files/test.txt', file_create_url('private://test.txt'), 'Private external URL correctly built.');
   }
 
   /**
@@ -110,7 +110,7 @@ public function testFileFunctions() {
 
     // Open for rw and place pointer at beginning of file so select will return.
     $handle = fopen($filename, 'c+');
-    $this->assertTrue($handle, 'Able to open a file for appending, reading and writing.');
+    $this->assertNotFalse($handle, 'Able to open a file for appending, reading and writing.');
 
     // Attempt to change options on the file stream: should all fail.
     $this->assertFalse(@stream_set_blocking($handle, 0), 'Unable to set to non blocking using a local stream wrapper.');
diff --git a/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php
index d3c5cd4..35031b4 100644
--- a/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php
@@ -21,7 +21,7 @@ public function testNormal() {
     // Copying to a new name.
     $desired_filepath = 'public://' . $this->randomMachineName();
     $new_filepath = file_unmanaged_copy($uri, $desired_filepath, FILE_EXISTS_ERROR);
-    $this->assertTrue($new_filepath, 'Copy was successful.');
+    $this->assertNotFalse($new_filepath, 'Copy was successful.');
     $this->assertEqual($new_filepath, $desired_filepath, 'Returned expected filepath.');
     $this->assertTrue(file_exists($uri), 'Original file remains.');
     $this->assertTrue(file_exists($new_filepath), 'New file exists.');
@@ -29,9 +29,9 @@ public function testNormal() {
 
     // Copying with rename.
     $desired_filepath = 'public://' . $this->randomMachineName();
-    $this->assertTrue(file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.');
+    $this->assertEquals(1, file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.');
     $newer_filepath = file_unmanaged_copy($uri, $desired_filepath, FILE_EXISTS_RENAME);
-    $this->assertTrue($newer_filepath, 'Copy was successful.');
+    $this->assertNotFalse($newer_filepath, 'Copy was successful.');
     $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.');
     $this->assertTrue(file_exists($uri), 'Original file remains.');
     $this->assertTrue(file_exists($newer_filepath), 'New file exists.');
@@ -61,7 +61,7 @@ public function testOverwriteSelf() {
 
     // Copy the file onto itself with renaming works.
     $new_filepath = file_unmanaged_copy($uri, $uri, FILE_EXISTS_RENAME);
-    $this->assertTrue($new_filepath, 'Copying onto itself with renaming works.');
+    $this->assertNotFalse($new_filepath, 'Copying onto itself with renaming works.');
     $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.');
     $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.');
     $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.');
@@ -79,7 +79,7 @@ public function testOverwriteSelf() {
 
     // Copy the file into same directory with renaming works.
     $new_filepath = file_unmanaged_copy($uri, drupal_dirname($uri), FILE_EXISTS_RENAME);
-    $this->assertTrue($new_filepath, 'Copying into same directory works.');
+    $this->assertNotFalse($new_filepath, 'Copying into same directory works.');
     $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.');
     $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.');
     $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.');
diff --git a/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php
index 8619a15..1d57a50 100644
--- a/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php
@@ -21,7 +21,7 @@ public function testNormal() {
     // Moving to a new name.
     $desired_filepath = 'public://' . $this->randomMachineName();
     $new_filepath = file_unmanaged_move($uri, $desired_filepath, FILE_EXISTS_ERROR);
-    $this->assertTrue($new_filepath, 'Move was successful.');
+    $this->assertNotFalse($new_filepath, 'Move was successful.');
     $this->assertEqual($new_filepath, $desired_filepath, 'Returned expected filepath.');
     $this->assertTrue(file_exists($new_filepath), 'File exists at the new location.');
     $this->assertFalse(file_exists($uri), 'No file remains at the old location.');
@@ -30,9 +30,9 @@ public function testNormal() {
     // Moving with rename.
     $desired_filepath = 'public://' . $this->randomMachineName();
     $this->assertTrue(file_exists($new_filepath), 'File exists before moving.');
-    $this->assertTrue(file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.');
+    $this->assertEquals(1, file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.');
     $newer_filepath = file_unmanaged_move($new_filepath, $desired_filepath, FILE_EXISTS_RENAME);
-    $this->assertTrue($newer_filepath, 'Move was successful.');
+    $this->assertNotFalse($newer_filepath, 'Move was successful.');
     $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.');
     $this->assertTrue(file_exists($newer_filepath), 'File exists at the new location.');
     $this->assertFalse(file_exists($new_filepath), 'No file remains at the old location.');
@@ -65,7 +65,7 @@ public function testOverwriteSelf() {
 
     // Move the file onto itself with renaming will result in a new filename.
     $new_filepath = file_unmanaged_move($uri, $uri, FILE_EXISTS_RENAME);
-    $this->assertTrue($new_filepath, 'Moving onto itself with renaming works.');
+    $this->assertNotFalse($new_filepath, 'Moving onto itself with renaming works.');
     $this->assertFalse(file_exists($uri), 'Original file has been removed.');
     $this->assertTrue(file_exists($new_filepath), 'File exists after moving onto itself.');
   }
diff --git a/core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php
index 5493323..08097e1 100644
--- a/core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php
@@ -17,13 +17,13 @@ public function testFileSaveData() {
 
     // No filename.
     $filepath = file_unmanaged_save_data($contents);
-    $this->assertTrue($filepath, 'Unnamed file saved correctly.');
+    $this->assertNotFalse($filepath, 'Unnamed file saved correctly.');
     $this->assertEqual(file_uri_scheme($filepath), file_default_scheme(), "File was placed in Drupal's files directory.");
     $this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.');
 
     // Provide a filename.
     $filepath = file_unmanaged_save_data($contents, 'public://asdf.txt', FILE_EXISTS_REPLACE);
-    $this->assertTrue($filepath, 'Unnamed file saved correctly.');
+    $this->assertNotFalse($filepath, 'Unnamed file saved correctly.');
     $this->assertEqual('asdf.txt', drupal_basename($filepath), 'File was named correctly.');
     $this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.');
     $this->assertFilePermissions($filepath, 0777);
diff --git a/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php b/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
index f6fb4f8..8695c8a 100644
--- a/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
@@ -69,14 +69,14 @@ public function testCacheToken() {
     \Drupal::state()->set('system.private_key', 'invalid');
     $cached_form_state = new FormState();
     $cached_form = \Drupal::formBuilder()->getCache($this->formBuildId, $cached_form_state);
-    $this->assertFalse($cached_form, 'No form returned from cache');
+    $this->assertEmpty($cached_form, 'No form returned from cache');
     $cached_form_state_example = $cached_form_state->get('example');
     $this->assertTrue(empty($cached_form_state_example));
 
     // Test that loading the cache with a different form_id fails.
     $wrong_form_build_id = $this->randomMachineName(9);
     $cached_form_state = new FormState();
-    $this->assertFalse(\Drupal::formBuilder()->getCache($wrong_form_build_id, $cached_form_state), 'No form returned from cache');
+    $this->assertEmpty(\Drupal::formBuilder()->getCache($wrong_form_build_id, $cached_form_state), 'No form returned from cache');
     $cached_form_state_example = $cached_form_state->get('example');
     $this->assertTrue(empty($cached_form_state_example), 'Cached form state was not loaded');
   }
@@ -111,7 +111,7 @@ public function testCacheCustomExpiration() {
     \Drupal::formBuilder()->setCache($this->formBuildId, $this->form, $this->formState);
 
     $cached_form_state = new FormState();
-    $this->assertFalse(\Drupal::formBuilder()->getCache($this->formBuildId, $cached_form_state), 'Expired form not returned from cache');
+    $this->assertNull(\Drupal::formBuilder()->getCache($this->formBuildId, $cached_form_state), 'Expired form not returned from cache');
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
index 26a1abe..8b1143c 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
@@ -46,13 +46,13 @@ public function testCRUDWithExpiration() {
     $stores[0]->setWithExpire('foo', $this->objects[0], rand(500, 100000));
     $this->assertIdenticalObject($this->objects[0], $stores[0]->get('foo'));
     // Verify that the other collection is not affected.
-    $this->assertFalse($stores[1]->get('foo'));
+    $this->assertEmpty($stores[1]->get('foo'));
 
     // Verify that an item can be updated with setWithExpire().
     $stores[0]->setWithExpire('foo', $this->objects[1], rand(500, 100000));
     $this->assertIdenticalObject($this->objects[1], $stores[0]->get('foo'));
     // Verify that the other collection is still not affected.
-    $this->assertFalse($stores[1]->get('foo'));
+    $this->assertEmpty($stores[1]->get('foo'));
 
     // Verify that the expirable data key is unique.
     $stores[1]->setWithExpire('foo', $this->objects[2], rand(500, 100000));
@@ -72,7 +72,7 @@ public function testCRUDWithExpiration() {
 
     // Verify that the other collection was not affected.
     $this->assertIdenticalObject($stores[1]->get('foo'), $this->objects[2]);
-    $this->assertFalse($stores[1]->get('bar'));
+    $this->assertEmpty($stores[1]->get('bar'));
 
     // Verify that all items in a collection can be retrieved.
     // Ensure that an item with the same name exists in the other collection.
@@ -89,9 +89,9 @@ public function testCRUDWithExpiration() {
 
     // Verify that multiple items can be deleted.
     $stores[0]->deleteMultiple(array_keys($values));
-    $this->assertFalse($stores[0]->get('foo'));
-    $this->assertFalse($stores[0]->get('bar'));
-    $this->assertFalse($stores[0]->getMultiple(['foo', 'bar']));
+    $this->assertNull($stores[0]->get('foo'));
+    $this->assertNull($stores[0]->get('bar'));
+    $this->assertEmpty($stores[0]->getMultiple(['foo', 'bar']));
     // Verify that the item in the other collection still exists.
     $this->assertIdenticalObject($this->objects[5], $stores[1]->get('foo'));
 
@@ -103,7 +103,7 @@ public function testCRUDWithExpiration() {
       $this->assertEqual(!$i, $stores[0]->setWithExpireIfNotExists($key, $this->objects[$i], rand(500, 100000)));
       $this->assertIdenticalObject($this->objects[0], $stores[0]->get($key));
       // Verify that the other collection is not affected.
-      $this->assertFalse($stores[1]->get($key));
+      $this->assertEmpty($stores[1]->get($key));
     }
 
     // Remove the item and try to set it again.
@@ -112,7 +112,7 @@ public function testCRUDWithExpiration() {
     // This time it should succeed.
     $this->assertIdenticalObject($this->objects[1], $stores[0]->get($key));
     // Verify that the other collection is still not affected.
-    $this->assertFalse($stores[1]->get($key));
+    $this->assertEmpty($stores[1]->get($key));
 
   }
 
@@ -129,7 +129,7 @@ public function testExpiration() {
 
     // Only the non-expired item should be returned.
     $this->assertFalse($stores[0]->has('yesterday'));
-    $this->assertFalse($stores[0]->get('yesterday'));
+    $this->assertEmpty($stores[0]->get('yesterday'));
     $this->assertTrue($stores[0]->has('troubles'));
     $this->assertIdentical($stores[0]->get('troubles'), 'here to stay');
     $this->assertIdentical(count($stores[0]->getMultiple(['yesterday', 'troubles'])), 1);
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
index 31300db..1b5c9f2 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
@@ -38,14 +38,14 @@ public function testCRUD() {
     $empty = EntityTestLabel::create();
     $this->assertIdentical($empty->id->value, NULL);
     $this->assertIdentical($empty->name->value, NULL);
-    $this->assertTrue($empty->uuid->value);
+    $this->assertNotEmpty($empty->uuid->value);
     $this->assertIdentical($empty->langcode->value, $default_langcode);
 
     // Verify ConfigEntity properties/methods on the newly created empty entity.
     $this->assertIdentical($empty->isNew(), TRUE);
     $this->assertIdentical($empty->bundle(), 'entity_test_label');
     $this->assertIdentical($empty->id(), NULL);
-    $this->assertTrue($empty->uuid());
+    $this->assertNotEmpty($empty->uuid());
     $this->assertIdentical($empty->label(), NULL);
 
     // Verify Entity properties/methods on the newly created empty entity.
@@ -87,7 +87,7 @@ public function testCRUD() {
       'name' => $this->randomString(),
     ]);
     $this->assertIdentical($entity_test->id->value, $expected['id']);
-    $this->assertTrue($entity_test->uuid->value);
+    $this->assertNotEmpty($entity_test->uuid->value);
     $this->assertNotEqual($entity_test->uuid->value, $empty->uuid->value);
     $this->assertIdentical($entity_test->name->value, $expected['name']);
     $this->assertIdentical($entity_test->langcode->value, $default_langcode);
@@ -95,7 +95,7 @@ public function testCRUD() {
     // Verify methods on the newly created entity.
     $this->assertIdentical($entity_test->isNew(), TRUE);
     $this->assertIdentical($entity_test->id(), $expected['id']);
-    $this->assertTrue($entity_test->uuid());
+    $this->assertNotEmpty($entity_test->uuid());
     $expected['uuid'] = $entity_test->uuid();
     $this->assertIdentical($entity_test->label(), $expected['name']);
 
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
index 48af84d..eb5cfa3 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
@@ -57,13 +57,13 @@ public function testCRUD() {
     $this->assertIdenticalObject($this->objects[0], $stores[0]->get('foo'));
     // Verify that the other collection is not affected.
     $this->assertFalse($stores[1]->has('foo'));
-    $this->assertFalse($stores[1]->get('foo'));
+    $this->assertEmpty($stores[1]->get('foo'));
 
     // Verify that an item can be updated.
     $stores[0]->set('foo', $this->objects[1]);
     $this->assertIdenticalObject($this->objects[1], $stores[0]->get('foo'));
     // Verify that the other collection is still not affected.
-    $this->assertFalse($stores[1]->get('foo'));
+    $this->assertEmpty($stores[1]->get('foo'));
 
     // Verify that a collection/name pair is unique.
     $stores[1]->set('foo', $this->objects[2]);
@@ -73,13 +73,13 @@ public function testCRUD() {
     // Verify that an item can be deleted.
     $stores[0]->delete('foo');
     $this->assertFalse($stores[0]->has('foo'));
-    $this->assertFalse($stores[0]->get('foo'));
+    $this->assertEmpty($stores[0]->get('foo'));
 
     // Verify that the other collection is not affected.
     $this->assertTrue($stores[1]->has('foo'));
     $this->assertIdenticalObject($this->objects[2], $stores[1]->get('foo'));
     $stores[1]->delete('foo');
-    $this->assertFalse($stores[1]->get('foo'));
+    $this->assertEmpty($stores[1]->get('foo'));
 
     // Verify that multiple items can be stored.
     $values = [
@@ -95,8 +95,8 @@ public function testCRUD() {
     }
 
     // Verify that the other collection was not affected.
-    $this->assertFalse($stores[1]->get('foo'));
-    $this->assertFalse($stores[1]->get('bar'));
+    $this->assertEmpty($stores[1]->get('foo'));
+    $this->assertEmpty($stores[1]->get('bar'));
 
     // Verify that all items in a collection can be retrieved.
     // Ensure that an item with the same name exists in the other collection.
@@ -113,9 +113,9 @@ public function testCRUD() {
 
     // Verify that multiple items can be deleted.
     $stores[0]->deleteMultiple(array_keys($values));
-    $this->assertFalse($stores[0]->get('foo'));
-    $this->assertFalse($stores[0]->get('bar'));
-    $this->assertFalse($stores[0]->getMultiple(['foo', 'bar']));
+    $this->assertNull($stores[0]->get('foo'));
+    $this->assertNull($stores[0]->get('bar'));
+    $this->assertEmpty($stores[0]->getMultiple(['foo', 'bar']));
     // Verify that deleting no items does not cause an error.
     $stores[0]->deleteMultiple([]);
     // Verify that the item in the other collection still exists.
@@ -165,7 +165,7 @@ public function testSetIfNotExists() {
       $this->assertEqual(!$i, $stores[0]->setIfNotExists($key, $this->objects[$i]));
       $this->assertIdenticalObject($this->objects[0], $stores[0]->get($key));
       // Verify that the other collection is not affected.
-      $this->assertFalse($stores[1]->get($key));
+      $this->assertEmpty($stores[1]->get($key));
     }
 
     // Remove the item and try to set it again.
@@ -174,7 +174,7 @@ public function testSetIfNotExists() {
     // This time it should succeed.
     $this->assertIdenticalObject($this->objects[1], $stores[0]->get($key));
     // Verify that the other collection is still not affected.
-    $this->assertFalse($stores[1]->get($key));
+    $this->assertEmpty($stores[1]->get($key));
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
index ad3f04d..349468d 100644
--- a/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
@@ -353,7 +353,7 @@ public function testLoadByProperties() {
         $this->fail($message);
       }
       catch (\InvalidArgumentException $e) {
-        $this->assertTrue(preg_match('/^An invalid property name, .+ was specified. Allowed property names are:/', $e->getMessage()), 'Found expected exception message.');
+        $this->assertNotEmpty(preg_match('/^An invalid property name, .+ was specified. Allowed property names are:/', $e->getMessage()), 'Found expected exception message.');
         $this->pass($message);
       }
     }
diff --git a/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php b/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
index cd2ed51..7230cd5 100644
--- a/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
@@ -76,8 +76,8 @@ protected function runQueueTest($queue1, $queue2) {
     $queue1->createItem($data[2]);
     $queue1->createItem($data[3]);
 
-    $this->assertTrue($queue1->numberOfItems(), 'Queue 1 is not empty after adding items.');
-    $this->assertFalse($queue2->numberOfItems(), 'Queue 2 is empty while Queue 1 has items');
+    $this->assertNotEmpty($queue1->numberOfItems(), 'Queue 1 is not empty after adding items.');
+    $this->assertEmpty($queue2->numberOfItems(), 'Queue 2 is empty while Queue 1 has items');
 
     $items[] = $item = $queue1->claimItem();
     $new_items[] = $item->data;
@@ -98,8 +98,8 @@ protected function runQueueTest($queue1, $queue2) {
     }
 
     // Check that both queues are empty.
-    $this->assertFalse($queue1->numberOfItems(), 'Queue 1 is empty');
-    $this->assertFalse($queue2->numberOfItems(), 'Queue 2 is empty');
+    $this->assertEmpty($queue1->numberOfItems(), 'Queue 1 is empty');
+    $this->assertEmpty($queue2->numberOfItems(), 'Queue 2 is empty');
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
index 906e74b..dba7909 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
@@ -190,7 +190,7 @@ public function testMoreLink() {
     foreach ($elements as $element) {
       $xml = new \SimpleXMLElement(\Drupal::service('renderer')->renderRoot($element['value']));
       $result = $xml->xpath($element['expected']);
-      $this->assertTrue($result, '"' . $element['name'] . '" input rendered correctly by drupal_render().');
+      $this->assertNotEmpty($result, '"' . $element['name'] . '" input rendered correctly by drupal_render().');
     }
   }
 
@@ -221,7 +221,7 @@ public function testSystemCompactLink() {
     foreach ($elements as $element) {
       $xml = new \SimpleXMLElement(\Drupal::service('renderer')->renderRoot($element['value']));
       $result = $xml->xpath($element['expected']);
-      $this->assertTrue($result, '"' . $element['name'] . '" is rendered correctly by drupal_render().');
+      $this->assertNotEmpty($result, '"' . $element['name'] . '" is rendered correctly by drupal_render().');
     }
 
     // Set admin compact mode on for additional tests.
@@ -237,7 +237,7 @@ public function testSystemCompactLink() {
 
     $xml = new \SimpleXMLElement(\Drupal::service('renderer')->renderRoot($element['value']));
     $result = $xml->xpath($element['expected']);
-    $this->assertTrue($result, '"' . $element['name'] . '" is rendered correctly by drupal_render().');
+    $this->assertNotEmpty($result, '"' . $element['name'] . '" is rendered correctly by drupal_render().');
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
index ed59f2f..760a728 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
@@ -534,7 +534,7 @@ public function testOutlinePathNoMatch() {
 
 
     $routes = $provider->getRoutesByPattern($path);
-    $this->assertFalse(count($routes), 'No path found with this pattern.');
+    $this->assertEmpty(count($routes), 'No path found with this pattern.');
 
     $collection = $provider->getRouteCollectionForRequest($request);
     $this->assertTrue(count($collection) == 0, 'Empty route collection found with this pattern.');
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
index a20798e..998158d 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
@@ -39,10 +39,10 @@ public function testRaceCondition() {
     $lock_backend = \Drupal::lock();
     $registry = new ThemeRegistry($cid, $cache, $lock_backend, ['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
@@ -52,14 +52,14 @@ public 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, ['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');
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
index 61f6475..282982e 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
@@ -40,13 +40,13 @@ protected function setUp() {
    * Verifies that no themes are installed by default.
    */
   public function testEmpty() {
-    $this->assertFalse($this->extensionConfig()->get('theme'));
+    $this->assertEmpty($this->extensionConfig()->get('theme'));
 
-    $this->assertFalse(array_keys($this->themeHandler()->listInfo()));
-    $this->assertFalse(array_keys(system_list('theme')));
+    $this->assertEmpty(array_keys($this->themeHandler()->listInfo()));
+    $this->assertEmpty(array_keys(system_list('theme')));
 
     // Rebuilding available themes should always yield results though.
-    $this->assertTrue($this->themeHandler()->rebuildThemeData()['stark'], 'ThemeHandler::rebuildThemeData() yields all available themes.');
+    $this->assertNotEmpty($this->themeHandler()->rebuildThemeData()['stark'], 'ThemeHandler::rebuildThemeData() yields all available themes.');
 
     // theme_get_setting() should return global default theme settings.
     $this->assertIdentical(theme_get_setting('features.favicon'), TRUE);
@@ -85,7 +85,7 @@ public function testInstallSubTheme() {
     $base_name = 'test_basetheme';
 
     $themes = $this->themeHandler()->listInfo();
-    $this->assertFalse(array_keys($themes));
+    $this->assertEmpty(array_keys($themes));
 
     $this->themeInstaller()->install([$name]);
 
@@ -107,7 +107,7 @@ public function testInstallNonExisting() {
     $name = 'non_existing_theme';
 
     $themes = $this->themeHandler()->listInfo();
-    $this->assertFalse(array_keys($themes));
+    $this->assertEmpty(array_keys($themes));
 
     try {
       $message = 'ThemeHandler::install() throws InvalidArgumentException upon installing a non-existing theme.';
@@ -119,7 +119,7 @@ public function testInstallNonExisting() {
     }
 
     $themes = $this->themeHandler()->listInfo();
-    $this->assertFalse(array_keys($themes));
+    $this->assertEmpty(array_keys($themes));
   }
 
   /**
@@ -244,7 +244,7 @@ public function testUninstallNonExisting() {
     $name = 'non_existing_theme';
 
     $themes = $this->themeHandler()->listInfo();
-    $this->assertFalse(array_keys($themes));
+    $this->assertEmpty(array_keys($themes));
 
     try {
       $message = 'ThemeHandler::uninstall() throws InvalidArgumentException upon uninstalling a non-existing theme.';
@@ -256,7 +256,7 @@ public function testUninstallNonExisting() {
     }
 
     $themes = $this->themeHandler()->listInfo();
-    $this->assertFalse(array_keys($themes));
+    $this->assertEmpty(array_keys($themes));
   }
 
   /**
@@ -266,14 +266,14 @@ public function testUninstall() {
     $name = 'test_basetheme';
 
     $this->themeInstaller()->install([$name]);
-    $this->assertTrue($this->config("$name.settings")->get());
+    $this->assertNotEmpty($this->config("$name.settings")->get());
 
     $this->themeInstaller()->uninstall([$name]);
 
-    $this->assertFalse(array_keys($this->themeHandler()->listInfo()));
-    $this->assertFalse(array_keys(system_list('theme')));
+    $this->assertEmpty(array_keys($this->themeHandler()->listInfo()));
+    $this->assertEmpty(array_keys(system_list('theme')));
 
-    $this->assertFalse($this->config("$name.settings")->get());
+    $this->assertEmpty($this->config("$name.settings")->get());
 
     // Ensure that the uninstalled theme can be installed again.
     $this->themeInstaller()->install([$name]);
@@ -281,7 +281,7 @@ public function testUninstall() {
     $this->assertTrue(isset($themes[$name]));
     $this->assertEqual($themes[$name]->getName(), $name);
     $this->assertEqual(array_keys(system_list('theme')), array_keys($themes));
-    $this->assertTrue($this->config("$name.settings")->get());
+    $this->assertNotEmpty($this->config("$name.settings")->get());
   }
 
   /**
