While fixing a bug in [#8994195] I was momentarily confused by some duplicate assertion text.

Its a small thing but it made me investigate further as to exactly which test was failing.. I just want to remove this niggle from the next programmer who scans the code.

The duplicate text is Files removed from file history and the first of them which actually adds should read Files added to file history

 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((boolean) $result, 'Files removed from file history');
+    $this->assertTrue((boolean) $result, 'Files added to file history');
 
     // Remove a language.
     $this->drupalPostForm('admin/config/regional/language/delete/nl', array(), t('Delete'));
 
     // Check if the language data is removed from the database.
     $result = db_query("SELECT project FROM {locale_file} WHERE langcode='nl'")->fetchField();
-    $this->assertFalse($result, 'Files removed from file history');
+    $this->assertFalse((boolean) $result, 'Files removed from file history');
 
     // Check that the Dutch translation is gone.

NB Shamelessly, I have feature creeped this issue so that both lines symmetrically cast the result to a boolean.

Comments

martin107’s picture

Issue summary: View changes
dawehner’s picture

Status: Needs review » Needs work

assertFalse alreay casts to boolean values.

martin107’s picture

Status: Needs work » Needs review
StatusFileSize
new1.13 KB
new744 bytes

casting removed.

jhedstrom’s picture

Status: Needs review » Reviewed & tested by the community

This looks good. This change can be made during beta since it only cleans up testing code.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a unfrozen change as per https://www.drupal.org/core/beta-changes and it's benefits outweigh any disruption. Committed 10a80c8 and pushed to 8.0.x. Thanks!

  • alexpott committed 10a80c8 on 8.0.x
    Issue #2309051 by martin107: Duplicate assertion text in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.