Completed
Push — master ( efc44e...835840 )
by Pablo
02:59
created

GitIgnoreWriterHandlerTest::itShouldWriteData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace PhpGitHooks\Module\Git\Tests\Behaviour;
4
5
use PhpGitHooks\Module\Git\Contract\Command\GitIgnoreWriter;
6
use PhpGitHooks\Module\Git\Contract\Command\GitIgnoreWriterHandler;
7
use PhpGitHooks\Module\Git\Tests\Infrastructure\GitUnitTestCase;
8
use PhpGitHooks\Module\Tests\Infrastructure\Stub\StubCreator;
9
10
class GitIgnoreWriterHandlerTest extends GitUnitTestCase
11
{
12
    /**
13
     * @test
14
     */
15
    public function itShouldWriteData()
16
    {
17
        $content = StubCreator::faker()->text();
18
19
        $this->shouldWriteData($content);
20
21
        $commandHandler = new GitIgnoreWriterHandler($this->getWriter());
0 ignored issues
show
Bug introduced by
It seems like $this->getWriter() targeting PhpGitHooks\Module\Git\T...rfaceTrait::getWriter() can also be of type object<Mockery\MockInterface>; however, PhpGitHooks\Module\Git\C...rHandler::__construct() does only seem to accept object<PhpGitHooks\Modul...\Model\WriterInterface>, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
22
        $commandHandler->handle(new GitIgnoreWriter($content));
23
    }
24
}
25