2
class FailureTest extends PHPUnit_Framework_TestCase
4
public function testAssertArrayEqualsArray()
6
$this->assertEquals(array(1), array(2), 'message');
9
public function testAssertIntegerEqualsInteger()
11
$this->assertEquals(1, 2, 'message');
14
public function testAssertObjectEqualsObject()
22
$this->assertEquals($a, $b, 'message');
25
public function testAssertNullEqualsString()
27
$this->assertEquals(null, 'bar', 'message');
30
public function testAssertStringEqualsString()
32
$this->assertEquals('foo', 'bar', 'message');
35
public function testAssertTextEqualsText()
37
$this->assertEquals("foo\nbar\n", "foo\nbaz\n", 'message');
40
public function testAssertStringMatchesFormat()
42
$this->assertStringMatchesFormat('*%s*', '**', 'message');
45
public function testAssertNumericEqualsNumeric()
47
$this->assertEquals(1, 2, 'message');
50
public function testAssertTextSameText()
52
$this->assertSame('foo', 'bar', 'message');
55
public function testAssertObjectSameObject()
57
$this->assertSame(new StdClass, new StdClass, 'message');
60
public function testAssertObjectSameNull()
62
$this->assertSame(new StdClass, null, 'message');
65
public function testAssertFloatSameFloat()
67
$this->assertSame(1.0, 1.5, 'message');
70
// Note that due to the implementation of this assertion it counts as 2 asserts
71
public function testAssertStringMatchesFormatFile()
73
$this->assertStringMatchesFormatFile(__DIR__ . '/expectedFileFormat.txt', '...BAR...');