Commit 8212947a authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-4535 Change assert() to assertTrue()

Change record:
https://www.drupal.org/node/3129738
parent 4dcfebd7
......@@ -337,7 +337,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->drupalGet($path);
$this_code = $this->getSession()->getStatusCode();
$message = sprintf('Response status code for %s on path %s is %d; %d expected.', $role, $path, $this_code, $expected_code);
$this->assert(intval($this_code) === $expected_code, $message);
$this->assertTrue(intval($this_code) === $expected_code, $message);
if ($path === 'form/test-form' && !$this->loggedInUser) {
// Test for Honeypot element.
......@@ -586,7 +586,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$nid = $this->xpath('//a[text() = "View"]');
preg_match('/^node\/(\d+)$/', $nid[0]->getAttribute('data-drupal-link-system-path'), $matches);
$nid = (int) $matches[1];
$this->assert($nid > 0, 'Positive nid found.');
$this->assertTrue($nid > 0, 'Positive nid found.');
$content_nids[$content_type] = $nid;
// On node creation, the user is redirected to the layout edit page.
......@@ -658,7 +658,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->drupalGet('node/add/uw_ct_site_footer');
$match = preg_match(',site-footer/[^/]+/edit$,', $this->getSession()->getCurrentUrl());
$this->assert($match, 'Node add page for site footer redirects to edit page when a footer already exists.');
$this->assertTrue($match, 'Node add page for site footer redirects to edit page when a footer already exists.');
// Test uw_ct_sidebar. There is no title in the content type, only a node
// reference field.
......@@ -696,7 +696,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$url = $this->getSession()->getCurrentUrl();
// Check that moderation form URL is in the expected format.
$match = preg_match(',/admin/uw-content-moderation/\d+/\d+/\d+$,', $url);
$this->assert($match, 'Moderation form URL is in the expected format.');
$this->assertTrue($match, 'Moderation form URL is in the expected format.');
// Load home page edit page.
$this->drupalGet('home/edit');
......@@ -710,7 +710,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
// UWService::nodeIsHomePage().
$this->drupalLogin($this->drupalUsers['uw_role_site_manager']);
$this->assert(!UWService::nodeIsHomePage($content_nids['uw_ct_web_page']), 'UWService::nodeIsHomePage() correctly identifies page as not the home page.');
$this->assertTrue(!UWService::nodeIsHomePage($content_nids['uw_ct_web_page']), 'UWService::nodeIsHomePage() correctly identifies page as not the home page.');
// Test that certain options are available when not editing home page.
$this->drupalGet('node/' . $content_nids['uw_ct_web_page'] . '/edit');
......@@ -730,7 +730,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$path = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $content_nids['uw_ct_web_page']);
\Drupal::service('config.factory')->getEditable('system.site')->set('page.front', $path)->save();
$this->assert(UWService::nodeIsHomePage($content_nids['uw_ct_web_page']), 'UWService::nodeIsHomePage() correctly identifies page as the home page.');
$this->assertTrue(UWService::nodeIsHomePage($content_nids['uw_ct_web_page']), 'UWService::nodeIsHomePage() correctly identifies page as the home page.');
// Test that certain options are not available when editing home page.
$this->drupalGet('node/' . $content_nids['uw_ct_web_page'] . '/edit');
......@@ -976,7 +976,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
// Make sure Metatags display extender is enabled.
$views_display_extender_settings = \Drupal::config('views.settings')->get('display_extenders');
$this->assert(in_array('metatag_display_extender', $views_display_extender_settings), 'The metatags display extender is expected to be enabled.');
$this->assertTrue(in_array('metatag_display_extender', $views_display_extender_settings), 'The metatags display extender is expected to be enabled.');
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment