Total Complexity | 7 |
Total Lines | 85 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class MockActionElement |
||
9 | { |
||
10 | private $action; |
||
11 | |||
12 | 13 | public function __construct(Action $action) |
|
13 | { |
||
14 | 13 | $this->action = $action; |
|
15 | 13 | } |
|
16 | |||
17 | /** |
||
18 | * Assert that the action can be shown on the index view. |
||
19 | * |
||
20 | * @param string $message |
||
21 | * @return $this |
||
22 | */ |
||
23 | 2 | public function assertShownOnIndex(string $message = ''): self |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * Assert that the action is hidden from the index view. |
||
32 | * |
||
33 | * @param string $message |
||
34 | * @return $this |
||
35 | */ |
||
36 | 2 | public function assertHiddenFromIndex(string $message = ''): self |
|
37 | { |
||
38 | 2 | PHPUnit::assertFalse($this->action->showOnIndex, $message); |
|
39 | |||
40 | 1 | return $this; |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * Assert that the action can be shown on the detail view. |
||
45 | * |
||
46 | * @param string $message |
||
47 | * @return $this |
||
48 | */ |
||
49 | 2 | public function assertShownOnDetail(string $message = ''): self |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * Assert that the action is hidden from the detail view. |
||
58 | * |
||
59 | * @param string $message |
||
60 | * @return $this |
||
61 | */ |
||
62 | 2 | public function assertHiddenFromDetail(string $message = ''): self |
|
63 | { |
||
64 | 2 | PHPUnit::assertFalse($this->action->showOnDetail, $message); |
|
65 | |||
66 | 1 | return $this; |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * Assert that the action can be shown on table rows. |
||
71 | * |
||
72 | * @param string $message |
||
73 | * @return $this |
||
74 | */ |
||
75 | 2 | public function assertShownOnTableRow(string $message = ''): self |
|
76 | { |
||
77 | 2 | PHPUnit::assertTrue($this->action->showOnTableRow, $message); |
|
78 | |||
79 | 1 | return $this; |
|
80 | } |
||
81 | |||
82 | /** |
||
83 | * Assert that the action is hidden from table rows. |
||
84 | * |
||
85 | * @param string $message |
||
86 | * @return $this |
||
87 | */ |
||
88 | 2 | public function assertHiddenFromTableRow(string $message = ''): self |
|
93 | } |
||
94 | } |
||
95 |