1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<?php
namespace Hamcrest\Core;
class IsIdenticalTest extends \Hamcrest\AbstractMatcherTestCase
{
protected function createMatcher()
{
return \Hamcrest\Core\IsIdentical::identicalTo('irrelevant');
}
public function testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject()
{
$o1 = new \stdClass();
$o2 = new \stdClass();
assertThat($o1, identicalTo($o1));
assertThat($o2, not(identicalTo($o1)));
}
public function testReturnsReadableDescriptionFromToString()
{
$this->assertDescription('"ARG"', identicalTo('ARG'));
}
public function testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull()
{
$this->assertDescription('null', identicalTo(null));
}
}
|