Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class ResultTest extends TestCase |
||
11 | { |
||
12 | /** |
||
13 | * @test |
||
14 | */ |
||
15 | public function isValidByDefault(): void |
||
16 | { |
||
17 | $result = new Result(); |
||
18 | $this->assertTrue($result->isValid()); |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * @test |
||
23 | */ |
||
24 | public function errorsAreEmptyByDefault(): void |
||
25 | { |
||
26 | $result = new Result(); |
||
27 | $this->assertEmpty($result->getErrors()); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @test |
||
32 | */ |
||
33 | public function errorIsProperlyAdded(): void |
||
34 | { |
||
35 | $result = new Result(); |
||
36 | $result->addError('Error'); |
||
37 | $this->assertContains('Error', $result->getErrors()); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @test |
||
42 | */ |
||
43 | public function addingErrorChangesIsValid(): void |
||
44 | { |
||
45 | $result = new Result(); |
||
46 | $result->addError('Error'); |
||
47 | $this->assertFalse($result->isValid()); |
||
48 | } |
||
50 |