Skip to content

Commit 64cf29d

Browse files
committed
Add more test coverage one more time
1 parent 4721633 commit 64cf29d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/Terremoth/AsyncTest/PhpFileTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Terremoth\AsyncTest;
44

55
use PHPUnit\Framework\TestCase;
6+
use ReflectionException;
7+
use ReflectionMethod;
68
use Symfony\Component\Process\Process as SymfonyProcess;
79
use Terremoth\Async\PhpFile;
810
use 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
}

0 commit comments

Comments
 (0)