Skip to content

Commit 4759db7

Browse files
committed
Adjust test naming
1 parent cc70e49 commit 4759db7

File tree

7 files changed

+123
-65
lines changed

7 files changed

+123
-65
lines changed

tests/Unit/Template/Renderer/PlatesRendererTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Vfs\Node\Directory;
1212
use Vfs\Node\File;
1313

14+
/**
15+
* PlatesRendererTest
16+
*
17+
* @package SystemCtl\Test\Unit\Template\Renderer
18+
* @author icanhazstring <[email protected]>
19+
*/
1420
class PlatesRendererTest extends TestCase
1521
{
1622
/** @var FileSystem */

tests/Unit/Template/Section/InstallSectionTest.php

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,27 @@
66
use SystemCtl\Exception\PropertyNotSupportedException;
77
use SystemCtl\Template\Section\InstallSection;
88

9+
/**
10+
* InstallSectionTest
11+
*
12+
* @package SystemCtl\Test\Unit\Template\Section
13+
* @author icanhazstring <[email protected]>
14+
*/
915
class InstallSectionTest extends TestCase
1016
{
11-
public function testCreation()
17+
/**
18+
* @test
19+
*/
20+
public function itShouldCreateProperInstance()
1221
{
1322
$installSection = new InstallSection;
1423
$this->assertInstanceOf(InstallSection::class, $installSection);
1524
}
1625

17-
public function testValidProperties()
26+
/**
27+
* @test
28+
*/
29+
public function itShouldSetPropertiesAndReturnThem()
1830
{
1931
$installSection = (new InstallSection)
2032
->setAlias(['alias'])
@@ -28,21 +40,30 @@ public function testValidProperties()
2840
$this->assertEquals(['also'], $installSection->getAlso());
2941
}
3042

31-
public function testInvalidPropertyShouldRaiseException()
43+
/**
44+
* @test
45+
*/
46+
public function itShouldRaiseAnExceptionOnInvalidProperty()
3247
{
3348
$installSection = new InstallSection;
3449

3550
$this->expectException(PropertyNotSupportedException::class);
3651
$installSection->setFubar('should fail');
3752
}
3853

39-
public function testNonSetPropertyShouldReturnNull()
54+
/**
55+
* @test
56+
*/
57+
public function itShouldReturnNullIfAPropertyIsNotSet()
4058
{
4159
$installSection = new InstallSection;
4260
$this->assertNull($installSection->getWantedBy());
4361
}
4462

45-
public function testGetPropetiesShouldReturnOnlySetProperties()
63+
/**
64+
* @test
65+
*/
66+
public function itShouldReturnOnlyThosePropertiesPreviouslySet()
4667
{
4768
$installSection = new InstallSection;
4869

tests/Unit/Template/Section/ServiceSectionTest.php

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,30 @@
33
namespace SystemCtl\Test\Unit\Template\Section;
44

55
use PHPUnit\Framework\TestCase;
6-
use SystemCtl\Exception\PropertyNotSupportedException;
76
use SystemCtl\Template\Section\ServiceSection;
87

8+
/**
9+
* ServiceSectionTest
10+
*
11+
* @package SystemCtl\Test\Unit\Template\Section
12+
* @author icanhazstring <[email protected]>
13+
*/
914
class ServiceSectionTest extends TestCase
1015
{
11-
public function testCreation()
16+
17+
/**
18+
* @test
19+
*/
20+
public function itShouldCreateProperInstance()
1221
{
1322
$serviceSection = new ServiceSection;
1423
$this->assertInstanceOf(ServiceSection::class, $serviceSection);
1524
}
1625

17-
public function testValidProperties()
26+
/**
27+
* @test
28+
*/
29+
public function itShouldSetPropertiesAndReturnThem()
1830
{
1931
$serviceSection = (new ServiceSection)
2032
->setType(ServiceSection::TYPE_FORKING)
@@ -38,21 +50,10 @@ public function testValidProperties()
3850
$this->assertEquals('pid', $serviceSection->getPIDFile());
3951
}
4052

41-
public function testInvalidPropertyShouldRaiseException()
42-
{
43-
$serviceSection = new ServiceSection;
44-
45-
$this->expectException(PropertyNotSupportedException::class);
46-
$serviceSection->setFubar('should fail');
47-
}
48-
49-
public function testNonSetPropertyShouldReturnNull()
50-
{
51-
$serviceSection = new ServiceSection;
52-
$this->assertNull($serviceSection->getEnvironment());
53-
}
54-
55-
public function testGetPropetiesShouldReturnOnlySetProperties()
53+
/**
54+
* @test
55+
*/
56+
public function itShouldReturnOnlyThosePropertiesPreviouslySet()
5657
{
5758
$serviceSection = new ServiceSection;
5859

tests/Unit/Template/Section/TimerSectionTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,29 @@
33
namespace SystemCtl\Test\Unit\Template\Section;
44

55
use PHPUnit\Framework\TestCase;
6-
use SystemCtl\Exception\PropertyNotSupportedException;
76
use SystemCtl\Template\Section\TimerSection;
87

8+
/**
9+
* TimerSectionTest
10+
*
11+
* @package SystemCtl\Test\Unit\Template\Section
12+
* @author icanhazstring <[email protected]>
13+
*/
914
class TimerSectionTest extends TestCase
1015
{
11-
public function testCreation()
16+
/**
17+
* @test
18+
*/
19+
public function itShouldCreateProperInstance()
1220
{
1321
$timerSection = new TimerSection;
1422
$this->assertInstanceOf(TimerSection::class, $timerSection);
1523
}
1624

17-
public function testValidProperties()
25+
/**
26+
* @test
27+
*/
28+
public function itShouldSetPropertiesAndReturnThem()
1829
{
1930
$timerSection = (new TimerSection)
2031
->setOnCalendar('Wed..Sat *-*-* 1:00')
@@ -26,21 +37,10 @@ public function testValidProperties()
2637
$this->assertFalse($timerSection->shouldRemainAfterElapse());
2738
}
2839

29-
public function testInvalidPropertyShouldRaiseException()
30-
{
31-
$timerSection = new TimerSection;
32-
33-
$this->expectException(PropertyNotSupportedException::class);
34-
$timerSection->setFubar('should fail');
35-
}
36-
37-
public function testNonSetPropertyShouldReturnNull()
38-
{
39-
$timerSection = new TimerSection;
40-
$this->assertNull($timerSection->getOnCalendar());
41-
}
42-
43-
public function testGetPropetiesShouldReturnOnlySetProperties()
40+
/**
41+
* @test
42+
*/
43+
public function itShouldReturnOnlyThosePropertiesPreviouslySet()
4444
{
4545
$timerSection = new TimerSection;
4646

tests/Unit/Template/Section/UnitSectionTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,29 @@
33
namespace SystemCtl\Test\Unit\Template\Section;
44

55
use PHPUnit\Framework\TestCase;
6-
use SystemCtl\Exception\PropertyNotSupportedException;
76
use SystemCtl\Template\Section\UnitSection;
87

8+
/**
9+
* UnitSectionTest
10+
*
11+
* @package SystemCtl\Test\Unit\Template\Section
12+
* @author icanhazstring <[email protected]>
13+
*/
914
class UnitSectionTest extends TestCase
1015
{
11-
public function testCreation()
16+
/**
17+
* @test
18+
*/
19+
public function itShouldCreateProperInstance()
1220
{
1321
$unitSection = new UnitSection;
1422
$this->assertInstanceOf(UnitSection::class, $unitSection);
1523
}
1624

17-
public function testValidProperties()
25+
/**
26+
* @test
27+
*/
28+
public function itShouldSetPropertiesAndReturnThem()
1829
{
1930
$unitSection = (new UnitSection)
2031
->setDescription('TestDescription')
@@ -32,21 +43,10 @@ public function testValidProperties()
3243
$this->assertEquals(['g', 'h'], $unitSection->getConflicts());
3344
}
3445

35-
public function testInvalidPropertyShouldRaiseException()
36-
{
37-
$unitSection = new UnitSection;
38-
39-
$this->expectException(PropertyNotSupportedException::class);
40-
$unitSection->setFubar('should fail');
41-
}
42-
43-
public function testNonSetPropertyShouldReturnNull()
44-
{
45-
$unitSection = new UnitSection;
46-
$this->assertNull($unitSection->getDescription());
47-
}
48-
49-
public function testGetPropetiesShouldReturnOnlySetProperties()
46+
/**
47+
* @test
48+
*/
49+
public function itShouldReturnOnlyThosePropertiesPreviouslySet()
5050
{
5151
$unitSection = new UnitSection;
5252

tests/Unit/Template/ServiceUnitTemplateTest.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@
99
use SystemCtl\Template\ServiceUnitTemplate;
1010
use SystemCtl\Unit\Service;
1111

12+
/**
13+
* ServiceUnitTemplateTest
14+
*
15+
* @package SystemCtl\Test\Unit\Template
16+
* @author icanhazstring <[email protected]>
17+
*/
1218
class ServiceUnitTemplateTest extends TestCase
1319
{
14-
public function testSimpleUnitCreation()
20+
/**
21+
* @test
22+
*/
23+
public function itShouldCreateASimpleInstance()
1524
{
1625
$unitTemplate = new ServiceUnitTemplate('TestService');
1726

@@ -20,7 +29,10 @@ public function testSimpleUnitCreation()
2029
$this->assertEquals('TestService', $unitTemplate->getName());
2130
}
2231

23-
public function testEmptySectionAfterCreation()
32+
/**
33+
* @test
34+
*/
35+
public function itShouldReturnEmptySectionsAfterInstantiation()
2436
{
2537
$unitTemplate = new ServiceUnitTemplate('TestService');
2638

@@ -34,7 +46,10 @@ public function testEmptySectionAfterCreation()
3446
$this->assertEmpty($unitTemplate->getServiceSection()->getProperties());
3547
}
3648

37-
public function testUnitCreationWithSections()
49+
/**
50+
* @test
51+
*/
52+
public function itShouldReturnProperSectionValuesIfSet()
3853
{
3954
$unitTemplate = new ServiceUnitTemplate('TestService');
4055

tests/Unit/Template/TimerUnitTemplateTest.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@
99
use SystemCtl\Template\TimerUnitTemplate;
1010
use SystemCtl\Unit\Timer;
1111

12+
/**
13+
* TimerUnitTemplateTest
14+
*
15+
* @package SystemCtl\Test\Unit\Template
16+
* @author icanhazstring <[email protected]>
17+
*/
1218
class TimerUnitTemplateTest extends TestCase
1319
{
14-
public function testSimpleUnitCreation()
20+
/**
21+
* @test
22+
*/
23+
public function itShouldCreateASimpleInstance()
1524
{
1625
$unitTemplate = new TimerUnitTemplate('TestTimer');
1726

@@ -20,7 +29,10 @@ public function testSimpleUnitCreation()
2029
$this->assertEquals('TestTimer', $unitTemplate->getName());
2130
}
2231

23-
public function testEmptySectionAfterCreation()
32+
/**
33+
* @test
34+
*/
35+
public function itShouldReturnEmptySectionsAfterInstantiation()
2436
{
2537
$unitTemplate = new TimerUnitTemplate('TestTimer');
2638

@@ -34,7 +46,10 @@ public function testEmptySectionAfterCreation()
3446
$this->assertEmpty($unitTemplate->getTimerSection()->getProperties());
3547
}
3648

37-
public function testUnitCreationWithSections()
49+
/**
50+
* @test
51+
*/
52+
public function itShouldReturnProperSectionValuesIfSet()
3853
{
3954
$unitTemplate = new TimerUnitTemplate('TestTimer');
4055

0 commit comments

Comments
 (0)