|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace spec\Aggrego\Domain\Api\Command\TransformBoard; |
|
4
|
|
|
|
|
5
|
|
|
use PhpSpec\ObjectBehavior; |
|
6
|
|
|
use Prophecy\Argument; |
|
7
|
|
|
use Aggrego\Domain\Api\Command\TransformBoard\Command; |
|
|
|
|
|
|
8
|
|
|
use Aggrego\Domain\Api\Command\TransformBoard\UseCase; |
|
|
|
|
|
|
9
|
|
|
use Aggrego\Domain\Factory\ProfileBoardTransformationFactory; |
|
|
|
|
|
|
10
|
|
|
use Aggrego\Domain\Model\InitialBoard\Entity\Board as InitialBoard; |
|
|
|
|
|
|
11
|
|
|
use Aggrego\Domain\Model\ProgressBoard\Entity\Board as ProgressBoard; |
|
|
|
|
|
|
12
|
|
|
use Aggrego\Domain\Model\ProgressBoard\Repository as ProgressBoardRepository; |
|
|
|
|
|
|
13
|
|
|
use Aggrego\Domain\Model\ProgressBoard\ValueObject\Collection; |
|
|
|
|
|
|
14
|
|
|
use Aggrego\Domain\Model\Unit\Repository as UnitRepository; |
|
|
|
|
|
|
15
|
|
|
use Aggrego\Domain\Profile\BoardTransformation\Transformation; |
|
16
|
|
|
use Aggrego\Domain\ValueObject\Data; |
|
|
|
|
|
|
17
|
|
|
use Aggrego\Domain\ValueObject\Key; |
|
|
|
|
|
|
18
|
|
|
use Aggrego\Domain\ValueObject\Name; |
|
|
|
|
|
|
19
|
|
|
use Aggrego\Domain\ValueObject\Profile; |
|
|
|
|
|
|
20
|
|
|
use Aggrego\Domain\ValueObject\Source; |
|
|
|
|
|
|
21
|
|
|
use Aggrego\Domain\ValueObject\Uuid; |
|
|
|
|
|
|
22
|
|
|
use Aggrego\Domain\ValueObject\Version; |
|
|
|
|
|
|
23
|
|
|
|
|
24
|
|
|
class UseCaseSpec extends ObjectBehavior |
|
25
|
|
|
{ |
|
26
|
|
|
function let( |
|
|
|
|
|
|
27
|
|
|
ProgressBoardRepository $progressBoardRepository, |
|
28
|
|
|
UnitRepository $unitRepository, |
|
29
|
|
|
ProfileBoardTransformationFactory $boardTransformationFactory, |
|
30
|
|
|
Transformation $transformation |
|
31
|
|
|
) |
|
32
|
|
|
{ |
|
33
|
|
|
$key = new Key(['init']); |
|
34
|
|
|
$name = new Name('test'); |
|
35
|
|
|
$version = new Version('1.0'); |
|
36
|
|
|
$profile = new Profile($name, $version); |
|
37
|
|
|
|
|
38
|
|
|
$board = new InitialBoard($key, $profile); |
|
39
|
|
|
$board->addShard($key, new Source($name, $version)); |
|
40
|
|
|
$progressBoard = ProgressBoard::factoryFromInitial($board); |
|
41
|
|
|
$progressBoard->updateShard( |
|
42
|
|
|
new Uuid('4b7c7c15-6b50-5a1f-94ca-20a9749c5bc2'), |
|
43
|
|
|
new Source($name, $version), |
|
44
|
|
|
new Data('test') |
|
45
|
|
|
); |
|
46
|
|
|
|
|
47
|
|
|
$uuid = Argument::type(Uuid::class); |
|
48
|
|
|
$progressBoardRepository->getBoardByUuid($uuid)->willReturn($progressBoard); |
|
49
|
|
|
|
|
50
|
|
|
$boardTransformationFactory->factory($profile)->willReturn($transformation); |
|
51
|
|
|
|
|
52
|
|
|
$shards = Argument::type(Collection::class); |
|
53
|
|
|
$transformation->process($shards)->willReturn(new Data('test-double')); |
|
|
|
|
|
|
54
|
|
|
$this->beConstructedWith($progressBoardRepository, $unitRepository, $boardTransformationFactory); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
function it_is_initializable() |
|
58
|
|
|
{ |
|
59
|
|
|
$this->shouldHaveType(UseCase::class); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
function it_should_handle_command(Command $command) |
|
63
|
|
|
{ |
|
64
|
|
|
$command->getBoardUuid()->willReturn('123e4567-e89b-12d3-a456-426655440000'); |
|
65
|
|
|
$this->handle($command)->shouldBeNull(); |
|
|
|
|
|
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths