facile-it /
paraunit
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Paraunit\Tests\Unit\Process; |
||
| 4 | |||
| 5 | use Paraunit\Configuration\PHPUnitBinFile; |
||
| 6 | use Paraunit\Configuration\PHPUnitConfigFile; |
||
| 7 | use Paraunit\Process\ParaunitProcessAbstract; |
||
| 8 | use Paraunit\Process\ProcessFactory; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Class ProcessFactoryTest |
||
| 12 | * @package Paraunit\Tests\Unit\Process |
||
| 13 | */ |
||
| 14 | class ProcessFactoryTest extends \PHPUnit_Framework_TestCase |
||
| 15 | { |
||
| 16 | public function testCreateProcess() |
||
| 17 | { |
||
| 18 | $phpUnitBin = $this->prophesize('Paraunit\Configuration\PHPUnitBinFile'); |
||
| 19 | $phpUnitBin->getPhpUnitBin()->shouldBeCalled()->willReturn('phpunit'); |
||
| 20 | |||
| 21 | $phpUnitConfigFile = $this->prophesize('Paraunit\Configuration\PHPUnitConfigFile'); |
||
| 22 | $phpUnitConfigFile->getFileFullPath()->shouldBeCalled()->willReturn('configFile.xml'); |
||
| 23 | |||
| 24 | $factory = new ProcessFactory($phpUnitBin->reveal()); |
||
| 25 | $factory->setConfigFile($phpUnitConfigFile->reveal()); |
||
| 26 | |||
| 27 | $process = $factory->createProcess("TestTest.php"); |
||
| 28 | |||
| 29 | $this->assertInstanceOf('Paraunit\Process\ParaunitProcessAbstract', $process); |
||
| 30 | $this->assertEquals('phpunit -c configFile.xml --colors=never TestTest.php 2>&1', $process->getCommandLine()); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function testCreateProcessThrowsExceptionIfConfigIsMissing() |
||
| 34 | { |
||
| 35 | $phpUnitBin = $this->prophesize('Paraunit\Configuration\PHPUnitBinFile'); |
||
| 36 | |||
| 37 | $factory = new ProcessFactory($phpUnitBin->reveal()); |
||
| 38 | |||
| 39 | $this->setExpectedException('\Exception', 'config missing'); |
||
|
0 ignored issues
–
show
|
|||
| 40 | $factory->createProcess('test'); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.