Aggrego /
CommandLogicUnit
| 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\CommandLogicUnit\EventConsumer; |
||||||
| 15 | |||||||
| 16 | use Aggrego\CommandConsumer\Client as CommandConsumerClient; |
||||||
| 17 | use Aggrego\CommandConsumer\Command; |
||||||
| 18 | use Aggrego\CommandLogicUnit\EventConsumer\Client; |
||||||
| 19 | use Aggrego\CommandLogicUnit\EventProcessor\EventProcessor; |
||||||
| 20 | use Aggrego\CommandLogicUnit\Shared\EventProcessor\CommandCollection; |
||||||
| 21 | use Aggrego\EventConsumer\Shared\Event; |
||||||
| 22 | use PhpSpec\ObjectBehavior; |
||||||
| 23 | |||||||
| 24 | class ClientSpec extends ObjectBehavior |
||||||
| 25 | { |
||||||
| 26 | function let( |
||||||
|
0 ignored issues
–
show
|
|||||||
| 27 | EventProcessor $eventProcessor, |
||||||
| 28 | CommandConsumerClient $commandConsumerClient |
||||||
| 29 | ) |
||||||
| 30 | { |
||||||
| 31 | $this->beConstructedWith($eventProcessor, $commandConsumerClient); |
||||||
| 32 | } |
||||||
| 33 | |||||||
| 34 | function it_is_initializable() |
||||||
|
0 ignored issues
–
show
|
|||||||
| 35 | { |
||||||
| 36 | $this->shouldHaveType(Client::class); |
||||||
| 37 | } |
||||||
| 38 | |||||||
| 39 | function it_should_consume( |
||||||
| 40 | EventProcessor $eventProcessor, |
||||||
| 41 | CommandConsumerClient $commandConsumerClient, |
||||||
| 42 | Command $command, |
||||||
| 43 | Event $event |
||||||
| 44 | ) |
||||||
| 45 | { |
||||||
| 46 | $eventProcessor->transform($event)->willReturn(new CommandCollection($command->getWrappedObject())); |
||||||
|
0 ignored issues
–
show
The method
getWrappedObject() does not exist on Aggrego\CommandConsumer\Command.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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...
The method
willReturn() does not exist on Aggrego\CommandLogicUnit...essor\CommandCollection.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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...
|
|||||||
| 47 | $this->beConstructedWith($eventProcessor, $commandConsumerClient); |
||||||
| 48 | |||||||
| 49 | $this->consume($event)->shouldReturn(null); |
||||||
|
0 ignored issues
–
show
The method
consume() does not exist on spec\Aggrego\CommandLogi...ventConsumer\ClientSpec. 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
Loading history...
|
|||||||
| 50 | } |
||||||
| 51 | } |
||||||
| 52 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.