function let(Item $item, EntityId $entityId, Workflow $workflow, EntityRepository $entityRepository, StateRepository $stateRepository, TransactionHandler $transactionHandler, Step $step, Transition $transition, State $state, Listener $listener) { $workflow->getStep(static::STEP_NAME)->willReturn($step); $workflow->getStartTransition()->willReturn($transition); $workflow->getName()->willReturn(static::WORKFLOW_NAME); $step->isTransitionAllowed(static::TRANSITION_NAME)->willReturn(true); $workflow->getTransition(static::TRANSITION_NAME)->willReturn($transition); $transition->getName()->willReturn(static::TRANSITION_NAME); $transition->isInputRequired($item)->willReturn(false); $item->transit($transition, Argument::type(static::CONTEXT_CLASS), Argument::type(static::ERROR_COLLECTION_CLASS))->willReturn($state); $item->isWorkflowStarted()->willReturn(true); $item->getCurrentStepName()->willReturn(static::STEP_NAME); $item->getEntity()->willReturn(static::$entity); $entityId->__toString()->willReturn('entity::2'); $this->beConstructedWith($item, $workflow, static::TRANSITION_NAME, $entityRepository, $stateRepository, $transactionHandler, $listener); }
/** * {@inheritdoc} */ public function createItem(EntityId $entityId, $entity) { $key = $entityId->__toString(); if (!isset($this->items[$key])) { $this->items[$key] = $this->manager->createItem($entityId, $entity); } return $this->items[$key]; }
function it_does_not_equals_to_another_entity_id_with_different_provider_name(EntityId $otherEntitdId) { $otherEntitdId->__toString()->willReturn(static::PROVIDER_NAME . '_2::' . static::IDENTIFIER); $this->equals($otherEntitdId)->shouldReturn(false); }