1 | <?php |
||
7 | class LazyAssertionTest extends \PHPUnit_Framework_TestCase |
||
8 | { |
||
9 | /** |
||
10 | * @test |
||
11 | */ |
||
12 | public function it_collects_errors_until_assertall() |
||
29 | |||
30 | /** |
||
31 | * @test |
||
32 | */ |
||
33 | public function it_skips_assertions_of_current_chain_after_failure() |
||
46 | |||
47 | public function testLazyAssertionExceptionCanReturnAllErrors() |
||
65 | |||
66 | public function testVerifyNowReturnsTrueIfAssertionsPass() |
||
74 | |||
75 | public function testRestOfChainNotSkippedWhenThatAllUsed() |
||
76 | { |
||
77 | try { |
||
78 | \Assert\lazy() |
||
79 | ->thatAll(9.9, 'foo')->integer('must be int')->between(10, 20, 'must be between') |
||
80 | ->verifyNow(); |
||
81 | } catch (LazyAssertionException $ex) { |
||
82 | $this->assertEquals(array( |
||
83 | 'must be int', |
||
84 | 'must be between' |
||
85 | ), array_map(function (\Exception $ex) { |
||
86 | return $ex->getMessage(); |
||
87 | }, $ex->getErrorExceptions())); |
||
88 | } |
||
89 | } |
||
90 | |||
91 | public function testCallsToThatFollowingThatAllSkipAssertionsAfterFailure() |
||
105 | } |
||
106 |