forked from bruli/php-git-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommitMsgProcessorTest.php
More file actions
35 lines (28 loc) · 1.06 KB
/
CommitMsgProcessorTest.php
File metadata and controls
35 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace PhpGitHooks\Module\Configuration\Tests\Behaviour;
use PhpGitHooks\Module\Configuration\Service\CommitMsgProcessor;
use PhpGitHooks\Module\Configuration\Service\HookQuestions;
use PhpGitHooks\Module\Configuration\Tests\Infrastructure\ConfigurationUnitTestCase;
use PhpGitHooks\Module\Configuration\Tests\Stub\CommitMsgStub;
class CommitMsgProcessorTest extends ConfigurationUnitTestCase
{
/**
* @var CommitMsgProcessor
*/
private $commitMsgProcessor;
protected function setUp(): void
{
$this->commitMsgProcessor = new CommitMsgProcessor();
}
/**
* @test
*/
public function itShouldDisableHook()
{
$this->shouldAsk(HookQuestions::COMMIT_MSG_HOOK, HookQuestions::DEFAULT_TOOL_ANSWER, 'n');
$commitMsg = $this->commitMsgProcessor->process(CommitMsgStub::setUndefined(), $this->getIOInterface());
$this->assertFalse($commitMsg->isUndefined());
$this->assertFalse($commitMsg->isEnabled());
$this->assertNull($commitMsg->getRegularExpression()->value());
}
}