Skip to content

Commit 1f900d9

Browse files
Rename test for better readability
1 parent 767566b commit 1f900d9

File tree

1 file changed

+12
-54
lines changed

1 file changed

+12
-54
lines changed

tests/unit/Config/ActionTest.php

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,136 +15,94 @@
1515

1616
class ActionTest extends TestCase
1717
{
18-
/**
19-
* Tests Action::getJsonData
20-
*/
21-
public function testAllowFailure(): void
18+
public function testItCanAllowFailure(): void
2219
{
2320
$action = new Action('\\Foo\\Bar', [], [], ['allow-failure' => true]);
2421
$this->assertTrue($action->isFailureAllowed());
2522
}
2623

27-
/**
28-
* Tests Action::getJsonData
29-
*/
30-
public function testFailureNotAllowedByDefault(): void
24+
public function testItDoesNotAllowFailureByDefault(): void
3125
{
3226
// nothing configured so should not be allowed
3327
$action = new Action('\\Foo\\Bar', [], [], []);
3428
$this->assertFalse($action->isFailureAllowed());
3529
}
3630

37-
/**
38-
* Tests Action::getJsonData
39-
*/
40-
public function testFailureAllowedByDefault(): void
31+
public function testItAllowsChangingTheFailureDefault(): void
4132
{
4233
$action = new Action('\\Foo\\Bar');
4334
$this->assertTrue($action->isFailureAllowed(true));
4435
}
4536

46-
/**
47-
* Tests Action::getJsonData
48-
*/
49-
public function testFailureExcplitlyNotAllowed(): void
37+
public function testFailureCanBeExplicitlyDisallowed(): void
5038
{
5139
$action = new Action('\\Foo\\Bar', [], [], ['allow-failure' => false]);
5240
$this->assertFalse($action->isFailureAllowed(true));
5341
}
5442

55-
/**
56-
* Tests Action::getAction
57-
*/
58-
public function testGetAction(): void
43+
public function testItProvidesAccessToTheAction(): void
5944
{
6045
$action = new Action('\\Foo\\Bar');
61-
6246
$this->assertEquals('\\Foo\\Bar', $action->getAction());
6347
}
6448

65-
/**
66-
* Tests Action::getLabel
67-
*/
68-
public function testGetLabel(): void
49+
public function testItProvidesAccessToTheLabel(): void
6950
{
7051
$action = new Action('\\Foo\\Bar', [], [], ['label' => 'My label']);
71-
7252
$this->assertEquals('My label', $action->getLabel());
7353
}
7454

75-
/**
76-
* Tests Action::getLabel
77-
*/
78-
public function testGetLabelEmpty(): void
55+
public function testTheLabelIsEmptyByDefault(): void
7956
{
8057
$action = new Action('\\Foo\\Bar');
81-
8258
$this->assertEquals('\\Foo\\Bar', $action->getLabel());
8359
}
8460

85-
/**
86-
* Tests Action::getOptions
87-
*/
88-
public function testGetOptions(): void
61+
public function testItProvidedAccessToTheOptions(): void
8962
{
9063
$action = new Action('\\Foo\\Bar');
91-
9264
$this->assertEquals([], $action->getOptions()->getAll());
9365
}
9466

95-
/**
96-
* Tests Action::getJsonData
97-
*/
98-
public function testEmptyOptions(): void
67+
public function testThatOptionsAreEmptyByDefault(): void
9968
{
10069
$action = new Action('\\Foo\\Bar');
10170
$config = $action->getJsonData();
102-
10371
$this->assertCount(1, $config);
10472
}
10573

10674
/**
107-
* Tests Action::getJsonData
108-
*
10975
* @throws \Exception
11076
*/
111-
public function testConditions(): void
77+
public function testConditionsGetExportedToJson(): void
11278
{
11379
$conditions = [
11480
['exec' => '\\Foo\\Bar', 'args' => []]
11581
];
11682

11783
$action = new Action('\\Foo\\Bar', [], $conditions);
11884
$config = $action->getJsonData();
119-
12085
$this->assertCount(1, $config['conditions']);
12186
}
12287

12388
/**
124-
* Tests Action::getConditions
125-
*
12689
* @throws \Exception
12790
*/
128-
public function testGetConditions(): void
91+
public function testItProvidesAccessToConditions(): void
12992
{
13093
$conditions = [
13194
['exec' => '\\Foo\\Bar', 'args' => []],
13295
['exec' => '\\Fiz\\Baz', 'args' => []]
13396
];
13497

13598
$action = new Action('\\Foo\\Bar', [], $conditions);
136-
13799
$this->assertCount(2, $action->getConditions());
138100
}
139101

140-
/**
141-
* Tests Action::getJsonData
142-
*/
143-
public function testSettings(): void
102+
public function testSettingsWillBeExportedToJson(): void
144103
{
145104
$action = new Action('\\Foo\\Bar', [], [], ['allow-failure' => true]);
146105
$config = $action->getJsonData();
147-
148106
$this->assertCount(1, $config['config']);
149107
}
150108
}

0 commit comments

Comments
 (0)