dev-master
9999999-dev
MIT
The Requires
by Shota Hoshino
v0.1.0
0.1.0.0
MIT
The Requires
by Shota Hoshino
Wallogit.com
2017 © Pedro Peláez
PHPUnit helper for explicit object comparison., (*1)
Make it easier to your apps more safety by providing easy object assertion., (*2)
use Hshn\PHPUnit\Framework\Constraint\ObjectConstraintSupport; class MyTest extends \PHPUnit_Framework_TestCase { use ObjectConstraintSupport; }
public function test1() { // this constraint means: // property 'foo' start with 'a' and end with 'e' // and property 'bar' is true $constraint = $this->constraintFor(\stdClass::class) ->property('foo') ->stringStartsWith('a') ->stringEndsWith('e') ->property('bar') ->isTrue() ->getConstraint(); }
self::assertThat($value, $constraint);
MIT
MIT