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

GitIgnoreWriterHandlerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 5
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A itShouldWriteData() 0 9 1
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