Commit 2ef23872 authored by catch's avatar catch
Browse files

Issue #3193600 by ankithashetty, mondrake, daffie: Convert assertEqual() calls...

Issue #3193600 by ankithashetty, mondrake, daffie: Convert assertEqual() calls involving NULL, TRUE and FALSE to more appropriate PHPUnit assertions
parent 3022229a
Loading
Loading
Loading
Loading
+3 −3
Changes for core/modules/comment/tests/src/Functional/CommentStatisticsTest.php: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public function testCommentNodeCommentStatistics() {
    // Checks the initial values of node comment statistics with no comment.
    $node = $node_storage->load($this->node->id());
    $this->assertEqual($node->get('comment')->last_comment_timestamp, $this->node->getCreatedTime(), 'The initial value of node last_comment_timestamp is the node created date.');
    $this->assertEqual($node->get('comment')->last_comment_name, NULL, 'The initial value of node last_comment_name is NULL.');
    $this->assertNull($node->get('comment')->last_comment_name, 'The initial value of node last_comment_name is NULL.');
    $this->assertEqual($node->get('comment')->last_comment_uid, $this->webUser->id(), 'The initial value of node last_comment_uid is the node uid.');
    $this->assertEqual($node->get('comment')->comment_count, 0, 'The initial value of node comment_count is zero.');

@@ -69,7 +69,7 @@ public function testCommentNodeCommentStatistics() {
    // The node cache needs to be reset before reload.
    $node_storage->resetCache([$this->node->id()]);
    $node = $node_storage->load($this->node->id());
    $this->assertEqual($node->get('comment')->last_comment_name, NULL, 'The value of node last_comment_name is NULL.');
    $this->assertSame('', $node->get('comment')->last_comment_name, 'The value of node last_comment_name should be an empty string.');
    $this->assertEqual($node->get('comment')->last_comment_uid, $this->webUser2->id(), 'The value of node last_comment_uid is the comment #1 uid.');
    $this->assertEqual($node->get('comment')->comment_count, 1, 'The value of node comment_count is 1.');

@@ -93,7 +93,7 @@ public function testCommentNodeCommentStatistics() {
    // The node needs to be reloaded with the cache reset.
    $node_storage->resetCache([$this->node->id()]);
    $node = $node_storage->load($this->node->id());
    $this->assertEqual($node->get('comment')->last_comment_name, NULL, 'The value of node last_comment_name is still NULL.');
    $this->assertSame('', $node->get('comment')->last_comment_name, 'The value of node last_comment_name should be an empty string.');
    $this->assertEqual($node->get('comment')->last_comment_uid, $this->webUser2->id(), 'The value of node last_comment_uid is still the comment #1 uid.');
    $this->assertEqual($node->get('comment')->comment_count, 1, 'The value of node comment_count is still 1.');

+1 −1
Changes for core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ public function testAccessToAdministrativeFields() {
      foreach ($permutations as $set) {
        $may_view = $set['comment']->{$field}->access('view', $set['user']);
        $may_update = $set['comment']->{$field}->access('edit', $set['user']);
        $this->assertEqual($may_view, TRUE, new FormattableMarkup('User @user can view field @field on comment @comment', [
        $this->assertTrue($may_view, new FormattableMarkup('User @user can view field @field on comment @comment', [
          '@user' => $set['user']->getAccountName(),
          '@comment' => $set['comment']->getSubject(),
          '@field' => $field,
+1 −1
Changes for core/modules/editor/tests/src/Kernel/EditorImageDialogTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ public function testEditorImageDialog() {

    // Assert these two values are present and we don't get the 'not-this'
    // default back.
    $this->assertEqual(FALSE, $form_state->getValue(['attributes', 'hasCaption'], 'not-this'));
    $this->assertFalse($form_state->getValue(['attributes', 'hasCaption'], 'not-this'));
  }

}
+1 −1
Changes for core/modules/field/tests/src/Kernel/FieldCrudTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ public function testCreateField() {
    unset($config['settings']['config_data_from_field_setting']);

    // Check that default values are set.
    $this->assertEqual($config['required'], FALSE, 'Required defaults to false.');
    $this->assertFalse($config['required'], 'Required defaults to false.');
    $this->assertIdentical($config['label'], $this->fieldDefinition['field_name'], 'Label defaults to field name.');
    $this->assertIdentical('', $config['description'], 'Description defaults to empty string.');

+1 −1
Changes for core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ public function testInstallation() {
    $this->assertNotEmpty($format->uuid());

    // Verify that the loaded format does not contain any roles.
    $this->assertEqual($format->get('roles'), NULL);
    $this->assertNull($format->get('roles'));
    // Verify that the defined roles in the default config have been processed.
    $this->assertEqual(array_keys(filter_get_roles_by_format($format)), [
      RoleInterface::ANONYMOUS_ID,
Loading