|
15 | 15 |
|
16 | 16 | class ActionTest extends TestCase
|
17 | 17 | {
|
18 |
| - /** |
19 |
| - * Tests Action::getJsonData |
20 |
| - */ |
21 |
| - public function testAllowFailure(): void |
| 18 | + public function testItCanAllowFailure(): void |
22 | 19 | {
|
23 | 20 | $action = new Action('\\Foo\\Bar', [], [], ['allow-failure' => true]);
|
24 | 21 | $this->assertTrue($action->isFailureAllowed());
|
25 | 22 | }
|
26 | 23 |
|
27 |
| - /** |
28 |
| - * Tests Action::getJsonData |
29 |
| - */ |
30 |
| - public function testFailureNotAllowedByDefault(): void |
| 24 | + public function testItDoesNotAllowFailureByDefault(): void |
31 | 25 | {
|
32 | 26 | // nothing configured so should not be allowed
|
33 | 27 | $action = new Action('\\Foo\\Bar', [], [], []);
|
34 | 28 | $this->assertFalse($action->isFailureAllowed());
|
35 | 29 | }
|
36 | 30 |
|
37 |
| - /** |
38 |
| - * Tests Action::getJsonData |
39 |
| - */ |
40 |
| - public function testFailureAllowedByDefault(): void |
| 31 | + public function testItAllowsChangingTheFailureDefault(): void |
41 | 32 | {
|
42 | 33 | $action = new Action('\\Foo\\Bar');
|
43 | 34 | $this->assertTrue($action->isFailureAllowed(true));
|
44 | 35 | }
|
45 | 36 |
|
46 |
| - /** |
47 |
| - * Tests Action::getJsonData |
48 |
| - */ |
49 |
| - public function testFailureExcplitlyNotAllowed(): void |
| 37 | + public function testFailureCanBeExplicitlyDisallowed(): void |
50 | 38 | {
|
51 | 39 | $action = new Action('\\Foo\\Bar', [], [], ['allow-failure' => false]);
|
52 | 40 | $this->assertFalse($action->isFailureAllowed(true));
|
53 | 41 | }
|
54 | 42 |
|
55 |
| - /** |
56 |
| - * Tests Action::getAction |
57 |
| - */ |
58 |
| - public function testGetAction(): void |
| 43 | + public function testItProvidesAccessToTheAction(): void |
59 | 44 | {
|
60 | 45 | $action = new Action('\\Foo\\Bar');
|
61 |
| - |
62 | 46 | $this->assertEquals('\\Foo\\Bar', $action->getAction());
|
63 | 47 | }
|
64 | 48 |
|
65 |
| - /** |
66 |
| - * Tests Action::getLabel |
67 |
| - */ |
68 |
| - public function testGetLabel(): void |
| 49 | + public function testItProvidesAccessToTheLabel(): void |
69 | 50 | {
|
70 | 51 | $action = new Action('\\Foo\\Bar', [], [], ['label' => 'My label']);
|
71 |
| - |
72 | 52 | $this->assertEquals('My label', $action->getLabel());
|
73 | 53 | }
|
74 | 54 |
|
75 |
| - /** |
76 |
| - * Tests Action::getLabel |
77 |
| - */ |
78 |
| - public function testGetLabelEmpty(): void |
| 55 | + public function testTheLabelIsEmptyByDefault(): void |
79 | 56 | {
|
80 | 57 | $action = new Action('\\Foo\\Bar');
|
81 |
| - |
82 | 58 | $this->assertEquals('\\Foo\\Bar', $action->getLabel());
|
83 | 59 | }
|
84 | 60 |
|
85 |
| - /** |
86 |
| - * Tests Action::getOptions |
87 |
| - */ |
88 |
| - public function testGetOptions(): void |
| 61 | + public function testItProvidedAccessToTheOptions(): void |
89 | 62 | {
|
90 | 63 | $action = new Action('\\Foo\\Bar');
|
91 |
| - |
92 | 64 | $this->assertEquals([], $action->getOptions()->getAll());
|
93 | 65 | }
|
94 | 66 |
|
95 |
| - /** |
96 |
| - * Tests Action::getJsonData |
97 |
| - */ |
98 |
| - public function testEmptyOptions(): void |
| 67 | + public function testThatOptionsAreEmptyByDefault(): void |
99 | 68 | {
|
100 | 69 | $action = new Action('\\Foo\\Bar');
|
101 | 70 | $config = $action->getJsonData();
|
102 |
| - |
103 | 71 | $this->assertCount(1, $config);
|
104 | 72 | }
|
105 | 73 |
|
106 | 74 | /**
|
107 |
| - * Tests Action::getJsonData |
108 |
| - * |
109 | 75 | * @throws \Exception
|
110 | 76 | */
|
111 |
| - public function testConditions(): void |
| 77 | + public function testConditionsGetExportedToJson(): void |
112 | 78 | {
|
113 | 79 | $conditions = [
|
114 | 80 | ['exec' => '\\Foo\\Bar', 'args' => []]
|
115 | 81 | ];
|
116 | 82 |
|
117 | 83 | $action = new Action('\\Foo\\Bar', [], $conditions);
|
118 | 84 | $config = $action->getJsonData();
|
119 |
| - |
120 | 85 | $this->assertCount(1, $config['conditions']);
|
121 | 86 | }
|
122 | 87 |
|
123 | 88 | /**
|
124 |
| - * Tests Action::getConditions |
125 |
| - * |
126 | 89 | * @throws \Exception
|
127 | 90 | */
|
128 |
| - public function testGetConditions(): void |
| 91 | + public function testItProvidesAccessToConditions(): void |
129 | 92 | {
|
130 | 93 | $conditions = [
|
131 | 94 | ['exec' => '\\Foo\\Bar', 'args' => []],
|
132 | 95 | ['exec' => '\\Fiz\\Baz', 'args' => []]
|
133 | 96 | ];
|
134 | 97 |
|
135 | 98 | $action = new Action('\\Foo\\Bar', [], $conditions);
|
136 |
| - |
137 | 99 | $this->assertCount(2, $action->getConditions());
|
138 | 100 | }
|
139 | 101 |
|
140 |
| - /** |
141 |
| - * Tests Action::getJsonData |
142 |
| - */ |
143 |
| - public function testSettings(): void |
| 102 | + public function testSettingsWillBeExportedToJson(): void |
144 | 103 | {
|
145 | 104 | $action = new Action('\\Foo\\Bar', [], [], ['allow-failure' => true]);
|
146 | 105 | $config = $action->getJsonData();
|
147 |
| - |
148 | 106 | $this->assertCount(1, $config['config']);
|
149 | 107 | }
|
150 | 108 | }
|
0 commit comments