|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Sylius package. |
| 5 | + * |
| 6 | + * (c) Sylius Sp. z o.o. |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +declare(strict_types=1); |
| 13 | + |
| 14 | +namespace spec\Sylius\Component\Resource\StateMachine; |
| 15 | + |
| 16 | +use PhpSpec\ObjectBehavior; |
| 17 | +use Sylius\Component\Resource\StateMachine\StateMachine; |
| 18 | +use Sylius\Component\Resource\StateMachine\StateMachineInterface as LegacyStateMachineInterface; |
| 19 | +use Sylius\Resource\StateMachine\StateMachine as NewStateMachine; |
| 20 | +use Sylius\Resource\StateMachine\StateMachineInterface; |
| 21 | +use Sylius\Resource\Tests\Dummy\PullRequest; |
| 22 | + |
| 23 | +final class StateMachineSpec extends ObjectBehavior |
| 24 | +{ |
| 25 | + function let(): void |
| 26 | + { |
| 27 | + $this->beConstructedWith(new PullRequest(), [ |
| 28 | + 'graph' => 'pull_request', |
| 29 | + 'property_path' => 'currentPlace', |
| 30 | + 'places' => [ |
| 31 | + 'start', |
| 32 | + 'test', |
| 33 | + ], |
| 34 | + 'transitions' => [ |
| 35 | + 'submit' => [ |
| 36 | + 'from' => ['start'], |
| 37 | + 'to' => 'test', |
| 38 | + ], |
| 39 | + ], |
| 40 | + ]); |
| 41 | + } |
| 42 | + |
| 43 | + function it_is_initializable(): void |
| 44 | + { |
| 45 | + $this->shouldHaveType(StateMachine::class); |
| 46 | + } |
| 47 | + |
| 48 | + function it_implements_state_machine_interface(): void |
| 49 | + { |
| 50 | + $this->shouldImplement(StateMachineInterface::class); |
| 51 | + } |
| 52 | + |
| 53 | + function it_implements_legacy_state_machine_interface(): void |
| 54 | + { |
| 55 | + $this->shouldImplement(LegacyStateMachineInterface::class); |
| 56 | + } |
| 57 | + |
| 58 | + function it_should_be_an_alias_of_state_machine(): void |
| 59 | + { |
| 60 | + $this->shouldImplement(NewStateMachine::class); |
| 61 | + } |
| 62 | +} |
0 commit comments