Commit 5aed7703 authored by git's avatar git Committed by Damien McKenna
Browse files

Issue #3135365 by novchuk.v, mero.S: Replace assertions involving calls to...

Issue #3135365 by novchuk.v, mero.S: Replace assertions involving calls to empty() with assertEmpty()/assertNotEmpty()/assertArrayNotHasKey().
parent c07ed5ba
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx
  classes, use dependency injection instead.
#2996883 by rokzabukovec, mrinalini9, thejimbirch, DamienMcKenna, Nchase,
  Schwarz Developing: Sorting the output of meta tags.
#3135365 by novchuk.v, mero.S: Replace assertions involving calls to empty()
  with assertEmpty()/assertNotEmpty()/assertArrayNotHasKey().


Metatag 8.x-1.14, 2020-08-11
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ class DefaultTags extends BrowserTestBase {
    foreach ($routes as $route) {
      // Identify the path to load.
      $this_page_url = $this->buildUrl($route, ['absolute' => TRUE]);
      $this->assertTrue(!empty($this_page_url));
      $this->assertNotEmpty($this_page_url);

      // Load the path.
      $this->drupalGet($this_page_url);
+7 −7
Original line number Diff line number Diff line
@@ -188,13 +188,13 @@ class MetatagAdminTest extends BrowserTestBase {

    // Check through the values that are in the 'select' list, make sure that
    // unwanted items are not present.
    $this->assertFalse(isset($types['block_content']), 'Custom block entities are not supported.');
    $this->assertFalse(isset($types['comment']), 'Comment entities are not supported.');
    $this->assertFalse(isset($types['menu_link_content']), 'Menu link entities are not supported.');
    $this->assertFalse(isset($types['shortcut']), 'Shortcut entities are not supported.');
    $this->assertTrue(isset($types['node__page']), 'Nodes are supported.');
    $this->assertTrue(isset($types['user__user']), 'Users are supported.');
    $this->assertTrue(isset($types['entity_test']), 'Test entities are supported.');
    $this->assertArrayNotHasKey('block_content', $types, 'Custom block entities are not supported.');
    $this->assertArrayNotHasKey('comment', $types, 'Comment entities are not supported.');
    $this->assertArrayNotHasKey('menu_link_content', $types, 'Menu link entities are not supported.');
    $this->assertArrayNotHasKey('shortcut', $types, 'Shortcut entities are not supported.');
    $this->assertArrayHasKey('node__page', $types, 'Nodes are supported.');
    $this->assertArrayHasKey('user__user', $types, 'Users are supported.');
    $this->assertArrayHasKey('entity_test', $types, 'Test entities are supported.');
  }

  /**
+2 −2
Original line number Diff line number Diff line
@@ -64,10 +64,10 @@ class NodeJsonOutput extends BrowserTestBase {

    // Decode the JSON output.
    $response = $this->getRawContent();
    $this->assertTrue(!empty($response));
    $this->assertNotEmpty($response);
    $json = json_decode($response);
    $this->verbose($json, 'JSON output');
    $this->assertTrue(!empty($json));
    $this->assertNotEmpty($json);

    // Confirm the JSON object's values.
    $this->assertTrue(isset($json->nid));