Commit cf64091c authored by catch's avatar catch
Browse files

Issue #3132919 by mondrake, pavnish, tvb, jungle, msuthars, ridhimaabrol24,...

Issue #3132919 by mondrake, pavnish, tvb, jungle, msuthars, ridhimaabrol24, Hardik_Patel_12, mrinalini9, Suresh Prabhu Parkala, longwave, ravi.shankar: Replace assert*() involving equality comparison operators with assert(Not)(Equals|Same)
parent f9fcde32
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public function testUpdateFeedItem() {
    $feed->refreshItems();

    $after = Item::load(array_values($item_ids)[0])->getPostedTime();
    $this->assertTrue($before === $after, new FormattableMarkup('Publish timestamp of feed item was not updated (@before === @after)', ['@before' => $before, '@after' => $after]));
    $this->assertSame($before, $after, new FormattableMarkup('Publish timestamp of feed item was not updated (@before === @after)', ['@before' => $before, '@after' => $after]));

    // Make sure updating items works even after uninstalling a module
    // that provides the selected plugins.
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ public function testBigPipeMultiOccurrencePlaceholders() {
    $this->assertNoRaw('The count is 2.');
    $this->assertNoRaw('The count is 3.');
    $raw_content = $this->getSession()->getPage()->getContent();
    $this->assertTrue(substr_count($raw_content, $expected_placeholder_replacement) == 1, 'Only one placeholder replacement was found for the duplicate #lazy_builder arrays.');
    $this->assertSame(1, substr_count($raw_content, $expected_placeholder_replacement), 'Only one placeholder replacement was found for the duplicate #lazy_builder arrays.');

    // By calling performMetaRefresh() here, we simulate JavaScript being
    // disabled, because as far as the BigPipe module is concerned, it is
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public function testBlockRenderOrder() {
    foreach ($controller->loadMultiple() as $return_block) {
      $id = $return_block->id();
      if ($return_block_weight = $return_block->getWeight()) {
        $this->assertTrue($test_blocks[$id]['weight'] == $return_block_weight, 'Block weight is set as "' . $return_block_weight . '" for ' . $id . ' block.');
        $this->assertSame((int) $test_blocks[$id]['weight'], $return_block_weight, 'Block weight is set as "' . $return_block_weight . '" for ' . $id . ' block.');
        $position[$id] = strpos($test_content, Html::getClass('block-' . $test_blocks[$id]['id']));
      }
    }
+5 −5
Original line number Diff line number Diff line
@@ -387,15 +387,15 @@ public function testLanguages() {
    $langcodes = $this->ckeditor->getLangcodes();

    // Language codes transformed with browser mappings.
    $this->assertTrue($langcodes['pt-pt'] == 'pt', '"pt" properly resolved');
    $this->assertTrue($langcodes['zh-hans'] == 'zh-cn', '"zh-hans" properly resolved');
    $this->assertSame('pt', $langcodes['pt-pt'], '"pt" properly resolved');
    $this->assertSame('zh-cn', $langcodes['zh-hans'], '"zh-hans" properly resolved');

    // Language code both in Drupal and CKEditor.
    $this->assertTrue($langcodes['gl'] == 'gl', '"gl" properly resolved');
    $this->assertSame('gl', $langcodes['gl'], '"gl" properly resolved');

    // Language codes only in CKEditor.
    $this->assertTrue($langcodes['en-au'] == 'en-au', '"en-au" properly resolved');
    $this->assertTrue($langcodes['sr-latn'] == 'sr-latn', '"sr-latn" properly resolved');
    $this->assertSame('en-au', $langcodes['en-au'], '"en-au" properly resolved');
    $this->assertSame('sr-latn', $langcodes['sr-latn'], '"sr-latn" properly resolved');

    // No locale module, so even though languages are enabled, CKEditor should
    // still be in English.
+4 −4
Original line number Diff line number Diff line
@@ -36,12 +36,12 @@ public function testCommentPublishUnpublishActions() {
    // Unpublish a comment.
    $action = Action::load('comment_unpublish_action');
    $action->execute([$comment]);
    $this->assertTrue($comment->isPublished() === FALSE, 'Comment was unpublished');
    $this->assertFalse($comment->isPublished(), 'Comment was unpublished');
    $this->assertSame(['module' => ['comment']], $action->getDependencies());
    // Publish a comment.
    $action = Action::load('comment_publish_action');
    $action->execute([$comment]);
    $this->assertTrue($comment->isPublished() === TRUE, 'Comment was published');
    $this->assertTrue($comment->isPublished(), 'Comment was published');
  }

  /**
@@ -67,10 +67,10 @@ public function testCommentUnpublishByKeyword() {
    // Load the full comment so that status is available.
    $comment = Comment::load($comment->id());

    $this->assertTrue($comment->isPublished() === TRUE, 'The comment status was set to published.');
    $this->assertTrue($comment->isPublished(), 'The comment status was set to published.');

    $action->execute([$comment]);
    $this->assertTrue($comment->isPublished() === FALSE, 'The comment status was set to not published.');
    $this->assertFalse($comment->isPublished(), 'The comment status was set to not published.');
  }

}
Loading