Issues (12)

spec/Domain/RepositorySpec.php (6 issues)

1
<?php
2
/**
3
 *
4
 * This file is part of the Aggrego.
5
 * (c) Tomasz Kunicki <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 */
11
12
declare(strict_types = 1);
13
14
namespace spec\Aggrego\DomainEventProducer\Domain;
15
16
use Aggrego\Domain\Board\Board;
17
use Aggrego\Domain\Board\Repository as DomainRepository;
18
use Aggrego\Domain\Board\Uuid;
19
use Aggrego\DomainEventProducer\Domain\Repository;
20
use PhpSpec\ObjectBehavior;
21
22
class RepositorySpec extends ObjectBehavior
23
{
24
    function let(DomainRepository $repository)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
25
    {
26
        $this->beConstructedWith($repository);
27
    }
28
29
    function it_is_initializable()
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
30
    {
31
        $this->shouldHaveType(Repository::class);
32
        $this->shouldHaveType(DomainRepository::class);
33
    }
34
35
    function it_should_add_board(Board $board)
36
    {
37
        $board->getUuid()->willReturn(new Uuid('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'));
0 ignored issues
show
The method willReturn() does not exist on Aggrego\Domain\Board\Uuid. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
        $board->getUuid()->/** @scrutinizer ignore-call */ willReturn(new Uuid('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
        $this->addBoard($board)->shouldReturn(null);
0 ignored issues
show
The method addBoard() does not exist on spec\Aggrego\DomainEvent...r\Domain\RepositorySpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
        $this->/** @scrutinizer ignore-call */ 
39
               addBoard($board)->shouldReturn(null);
Loading history...
39
    }
40
41
    function it_get_board_by_uuid(DomainRepository $repository, Board $board)
42
    {
43
        $repository->getBoardByUuid(new Uuid('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'))->willReturn($board);
0 ignored issues
show
The method willReturn() does not exist on Aggrego\Domain\Board\Board. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
        $repository->getBoardByUuid(new Uuid('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'))->/** @scrutinizer ignore-call */ willReturn($board);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
44
        $this->beConstructedWith($repository);
45
46
        $this->getBoardByUuid(new Uuid('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'))->shouldBeAnInstanceOf(Board::class);
0 ignored issues
show
The method getBoardByUuid() does not exist on spec\Aggrego\DomainEvent...r\Domain\RepositorySpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

46
        $this->/** @scrutinizer ignore-call */ 
47
               getBoardByUuid(new Uuid('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'))->shouldBeAnInstanceOf(Board::class);
Loading history...
47
    }
48
}
49