Skip to content

Commit 744fd48

Browse files
committed
Update coverage
1 parent 39e0b16 commit 744fd48

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

src/PhpGitHooks/Infrastructure/PhpUnit/PhpUnitRandomizerProcessBuilder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ final class PhpUnitRandomizerProcessBuilder extends PhpUnitProcessBuilder
1111
*/
1212
public function getProcessBuilder()
1313
{
14-
$process = new ProcessBuilder(array('php', 'bin/phpunit-randomizer', '--order', 'rand'));
15-
16-
return $process;
14+
return new ProcessBuilder(array('php', 'bin/phpunit-randomizer', '--order', 'rand'));
1715
}
1816
}

src/PhpGitHooks/Tests/Application/Composer/PreCommitProcessorTest.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Mockery\Mock;
77
use PhpGitHooks\Application\Composer\PreCommitProcessor;
88
use PhpGitHooks\Application\PhpCsFixer\InvalidPhpCsFixerConfigDataException;
9+
use PhpGitHooks\Application\PhpUnit\PhpUnitConfigDataException;
910

1011
class PreCommitProcessorTest extends \PHPUnit_Framework_TestCase
1112
{
@@ -192,4 +193,56 @@ public function phpCsFixerConfigDataHasInvalidEntryEnabled()
192193
]
193194
);
194195
}
196+
197+
/**
198+
* @test
199+
*/
200+
public function phpUnitConfigDataIsNotArray()
201+
{
202+
$this->setExpectedException(PhpUnitConfigDataException::class);
203+
$this->IO->shouldReceive('ask')
204+
->times(5)
205+
->andReturn('y');
206+
207+
$this->preCommitProcessor->execute(
208+
[
209+
'pre-commit' => [
210+
'execute' => [
211+
'phpunit' => true,
212+
'phpcs' => true,
213+
'phplint' => true,
214+
'phpmd' => true,
215+
'jsonlint' => true
216+
],
217+
'enabled' => true,
218+
],
219+
]
220+
);
221+
}
222+
223+
/**
224+
* @test
225+
*/
226+
public function phpUnitConfigDataInvalidEnabled()
227+
{
228+
$this->setExpectedException(PhpUnitConfigDataException::class);
229+
$this->IO->shouldReceive('ask')
230+
->times(5)
231+
->andReturn('y');
232+
233+
$this->preCommitProcessor->execute(
234+
[
235+
'pre-commit' => [
236+
'execute' => [
237+
'phpunit' => [],
238+
'phpcs' => true,
239+
'phplint' => true,
240+
'phpmd' => true,
241+
'jsonlint' => true
242+
],
243+
'enabled' => true,
244+
],
245+
]
246+
);
247+
}
195248
}

0 commit comments

Comments
 (0)