Files
Chamilo/vendor/winzou/state-machine/spec/SM/Callback/CascadeTransitionCallbackSpec.php
Xes 73154ae174
Behat tests 1.11.x 🐞 / PHP 7.4 Test on ubuntu-latest (push) Canceled after 0s
PHP-CS-Fixer / composer_install (7.4) (push) Canceled after 0s
Chamilo 1.11.40 (ZIP oficial v1.11.40)
Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip
sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439
Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
2026-08-06 17:59:45 +02:00

73 lines
1.9 KiB
PHP

<?php
namespace spec\SM\Callback;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use SM\Event\TransitionEvent;
use SM\Factory\FactoryInterface;
use SM\StateMachine\StateMachineInterface;
use spec\SM\DummyObject;
class CascadeTransitionCallbackSpec extends ObjectBehavior
{
function let(FactoryInterface $factory)
{
$this->beConstructedWith($factory);
}
function it_is_initializable()
{
$this->shouldHaveType('SM\Callback\CascadeTransitionCallback');
}
function it_applies($factory, TransitionEvent $event, DummyObject $object, StateMachineInterface $sm)
{
$factory->get($object, 'graph')->willReturn($sm);
$sm->can('transition')->willReturn(true);
$sm->apply('transition', true)->shouldBeCalled();
$this->apply($object, $event, 'transition', 'graph');
}
function it_applies_with_default_graph(
$factory,
TransitionEvent $event,
DummyObject $object,
StateMachineInterface $sm1,
StateMachineInterface $sm2
) {
$event->getStateMachine()->willReturn($sm2);
$sm2->getGraph()->willReturn('graph');
$factory->get($object, 'graph')->willReturn($sm1);
$sm1->can('transition')->willReturn(true);
$sm1->apply('transition', true)->shouldBeCalled();
$this->apply($object, $event, 'transition');
}
function it_applies_with_default_graph_and_default_transition(
$factory,
TransitionEvent $event,
DummyObject $object,
StateMachineInterface $sm1,
StateMachineInterface $sm2
) {
$event->getStateMachine()->willReturn($sm2);
$event->getTransition()->willReturn('transition');
$sm2->getGraph()->willReturn('graph');
$factory->get($object, 'graph')->willReturn($sm1);
$sm1->can('transition')->willReturn(true);
$sm1->apply('transition', true)->shouldBeCalled();
$this->apply($object, $event);
}
}