for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Assert\Tests;
class LazyAssertionTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function it_collects_errors_until_assertall()
$this->setExpectedException('Assert\LazyAssertionException', <<<EXC
The following 3 assertions failed:
1) foo: Value "10" expected to be string, type integer given.
2) bar: Value "<NULL>" is empty, but non empty value was expected.
3) baz: Value "string" is not an array.
EXC
);
\Assert\lazy()
->that(10, 'foo')->string()
->that(null, 'bar')->notEmpty()
->that('string', 'baz')->isArray()
->verifyNow();
}
public function it_skips_assertions_of_current_chain_after_failure()
The following 1 assertions failed:
1) foo: Value "<NULL>" is empty, but non empty value was expected.
->that(null, 'foo')->notEmpty()->string()