Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring tests #12345

Closed
wants to merge 1 commit into from
Closed

Refactoring tests #12345

wants to merge 1 commit into from

Conversation

carusogabriel
Copy link

@carusogabriel carusogabriel commented Dec 8, 2017

I've refactored several tests, using:

  • assertFileExists and assertFileNotExists instead of file_exists function;
  • assertArrayHasKey and assertArrayNotHasKey instead of isset and array_key_exists functions;
  • assertStringEqualsFile instead of file_get_contents function when comparing a string and a file;
  • assertFileEquals instead of file_get_contents function when comparing two files;
  • assertGreaterThan and assertLessThan for mathematical comparisons;
  • assertFalse and assertNotFalse instead of strict comparisons with false keyword;
  • assertTrue instead of strict comparisons with true keyword;
  • assertEmpty and assertNotEmpty instead of empty function;
  • assertInternalType instead of is_* functions;
  • assertEquals and assertNotEquals instead of comparisons;
  • assertSame and assertNotSame instead of comparisons;
  • assertContains instead of in_array and strpos functions;
  • assertCount instead of count and sizeof functions;
  • assertInstanceOf and assertNotInstanceOf instead of instanceof operator.

@sgiehl
Copy link
Member

sgiehl commented Dec 10, 2017

@carusogabriel thanks for the pull request. would you check why some tests are failing now? System and Integration tests should pass...

$this->assertTrue(false !== strpos($response[0], '<meta name="generator" content="Piwik - free/libre analytics platform"/>'), $message);
$this->assertTrue(false !== strpos($response[0], 'Widgetize the full dashboard'). $message);
$this->assertContains('<meta name="generator" content="Piwik - free/libre analytics platform"/>', $response[0], $message);
$this->assertContains('Widgetize the full dashboard', $response[0], $message);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgiehl The only error is here now. What is wrong that I'm missing?

@mattab mattab added this to the 3.4.0 milestone Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants