Skip to content

Instantly share code, notes, and snippets.

@bobagold
Created August 18, 2014 07:47
Show Gist options
  • Save bobagold/5424a4abb083dffa04e3 to your computer and use it in GitHub Desktop.
Save bobagold/5424a4abb083dffa04e3 to your computer and use it in GitHub Desktop.
PHPUnit makes me crazy
<?php
class PHPUnitTest extends \PHPUnit_Framework_TestCase
{
/**
* output of this test would be
* <cite>
* Failed asserting that 'cat does not have black fur' does not contain "cat does not have black fur".
* </cite>
* this is due to bad usage of PHPUnit_Framework_Constraint_Not::negate()
*/
public function testNotContains()
{
$this->assertNotContains('cat has black fur', 'cat has black fur');
$this->assertNotContains('basket is empty', 'aaaaa basket is empty bbbbbbbb', 'yes we did it');
}
}
@sebastianbergmann
Copy link

Can you please open a ticket for this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment