55use icanhazstring \SystemCtl \Unit \Device ;
66use PHPUnit \Framework \TestCase ;
77use Prophecy \Argument ;
8+ use Prophecy \PhpUnit \ProphecyTrait ;
89use Prophecy \Prophecy \ObjectProphecy ;
910use icanhazstring \SystemCtl \Command \CommandDispatcherInterface ;
1011use icanhazstring \SystemCtl \Command \CommandInterface ;
2122 */
2223class UnitTest extends TestCase
2324{
25+ use ProphecyTrait;
26+
2427 public function testServiceCommandsIfProcessIsSuccessfulShouldReturnTrue (): void
2528 {
2629 $ command = $ this ->prophesize (CommandInterface::class);
@@ -31,12 +34,12 @@ public function testServiceCommandsIfProcessIsSuccessfulShouldReturnTrue(): void
3134
3235 $ service = new Service ('AwesomeService ' , $ commandDispatcher ->reveal ());
3336
34- $ this -> assertTrue ($ service ->start ());
35- $ this -> assertTrue ($ service ->stop ());
36- $ this -> assertTrue ($ service ->enable ());
37- $ this -> assertTrue ($ service ->disable ());
38- $ this -> assertTrue ($ service ->reload ());
39- $ this -> assertTrue ($ service ->restart ());
37+ self :: assertTrue ($ service ->start ());
38+ self :: assertTrue ($ service ->stop ());
39+ self :: assertTrue ($ service ->enable ());
40+ self :: assertTrue ($ service ->disable ());
41+ self :: assertTrue ($ service ->reload ());
42+ self :: assertTrue ($ service ->restart ());
4043 }
4144
4245 public function createCommandDispatcherStub (): ObjectProphecy
@@ -69,12 +72,12 @@ public function testTimerCommandsIfProcessIsSuccessfulShouldReturnTrue(): void
6972
7073 $ timer = new Timer ('AwesomeService ' , $ commandDispatcher ->reveal ());
7174
72- $ this -> assertTrue ($ timer ->start ());
73- $ this -> assertTrue ($ timer ->stop ());
74- $ this -> assertTrue ($ timer ->enable ());
75- $ this -> assertTrue ($ timer ->disable ());
76- $ this -> assertTrue ($ timer ->reload ());
77- $ this -> assertTrue ($ timer ->restart ());
75+ self :: assertTrue ($ timer ->start ());
76+ self :: assertTrue ($ timer ->stop ());
77+ self :: assertTrue ($ timer ->enable ());
78+ self :: assertTrue ($ timer ->disable ());
79+ self :: assertTrue ($ timer ->reload ());
80+ self :: assertTrue ($ timer ->restart ());
7881 }
7982
8083 public function testTimerCommandsIfProcessIsUnsuccessFulShouldRaiseException (): void
@@ -98,12 +101,12 @@ public function testSocketCommandsIfProcessIsSuccessfulShouldReturnTrue(): void
98101
99102 $ socket = new Socket ('AwesomeSocket ' , $ commandDispatcher ->reveal ());
100103
101- $ this -> assertTrue ($ socket ->start ());
102- $ this -> assertTrue ($ socket ->stop ());
103- $ this -> assertTrue ($ socket ->enable ());
104- $ this -> assertTrue ($ socket ->disable ());
105- $ this -> assertTrue ($ socket ->reload ());
106- $ this -> assertTrue ($ socket ->restart ());
104+ self :: assertTrue ($ socket ->start ());
105+ self :: assertTrue ($ socket ->stop ());
106+ self :: assertTrue ($ socket ->enable ());
107+ self :: assertTrue ($ socket ->disable ());
108+ self :: assertTrue ($ socket ->reload ());
109+ self :: assertTrue ($ socket ->restart ());
107110 }
108111
109112 public function testSocketCommandsIfProcessIsUnsuccessFulShouldRaiseException (): void
@@ -127,12 +130,12 @@ public function testScopeCommandsIfProcessIsSuccessfulShouldReturnTrue(): void
127130
128131 $ scope = new Scope ('AwesomeScope ' , $ commandDispatcher ->reveal ());
129132
130- $ this -> assertTrue ($ scope ->start ());
131- $ this -> assertTrue ($ scope ->stop ());
132- $ this -> assertTrue ($ scope ->enable ());
133- $ this -> assertTrue ($ scope ->disable ());
134- $ this -> assertTrue ($ scope ->reload ());
135- $ this -> assertTrue ($ scope ->restart ());
133+ self :: assertTrue ($ scope ->start ());
134+ self :: assertTrue ($ scope ->stop ());
135+ self :: assertTrue ($ scope ->enable ());
136+ self :: assertTrue ($ scope ->disable ());
137+ self :: assertTrue ($ scope ->reload ());
138+ self :: assertTrue ($ scope ->restart ());
136139 }
137140
138141 public function testScopeCommandsIfProcessIsUnsuccessFulShouldRaiseException (): void
@@ -156,12 +159,12 @@ public function testDeviceCommandsIfProcessIsSuccessfulShouldReturnTrue()
156159
157160 $ device = new Device ('AwesomeDevice ' , $ commandDispatcher ->reveal ());
158161
159- $ this -> assertTrue ($ device ->start ());
160- $ this -> assertTrue ($ device ->stop ());
161- $ this -> assertTrue ($ device ->enable ());
162- $ this -> assertTrue ($ device ->disable ());
163- $ this -> assertTrue ($ device ->reload ());
164- $ this -> assertTrue ($ device ->restart ());
162+ self :: assertTrue ($ device ->start ());
163+ self :: assertTrue ($ device ->stop ());
164+ self :: assertTrue ($ device ->enable ());
165+ self :: assertTrue ($ device ->disable ());
166+ self :: assertTrue ($ device ->reload ());
167+ self :: assertTrue ($ device ->restart ());
165168 }
166169
167170 public function testDeviceCommandsIfProcessIsUnsuccessFulShouldRaiseException ()
0 commit comments