File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
tests/Terremoth/AsyncTest Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 33namespace Terremoth \AsyncTest ;
44
55use PHPUnit \Framework \TestCase ;
6+ use ReflectionException ;
7+ use ReflectionMethod ;
68use Symfony \Component \Process \Process as SymfonyProcess ;
79use Terremoth \Async \PhpFile ;
810use InvalidArgumentException ;
@@ -170,4 +172,23 @@ public function testRunExecutesUnixFlowWhenOsIsLinux(): void
170172 }
171173 }
172174 }
175+
176+ /**
177+ * @throws ReflectionException
178+ * @throws \PHPUnit\Framework\MockObject\Exception
179+ * @throws Exception
180+ */
181+ public function testStartProcessDelegatesToSymfonyProcess (): void
182+ {
183+ $ tempFile = $ this ->makeFile ('dummy_process.php ' , '<?php ' );
184+ $ phpFile = new PhpFile ($ tempFile );
185+
186+ $ symfonyProcessMock = $ this ->createMock (SymfonyProcess::class);
187+
188+ $ symfonyProcessMock ->expects ($ this ->once ())
189+ ->method ('start ' );
190+
191+ $ reflectionMethod = new ReflectionMethod (PhpFile::class, 'startProcess ' );
192+ $ reflectionMethod ->invoke ($ phpFile , $ symfonyProcessMock );
193+ }
173194}
You can’t perform that action at this time.
0 commit comments