function it_supports_denormalization_in_csv_of_a_family()
 {
     $this->supportsDenormalization([], self::ENTITY_CLASS, self::FORMAT_CSV)->shouldBe(true);
     $this->supportsDenormalization([], Argument::not(self::ENTITY_CLASS), self::FORMAT_CSV)->shouldBe(false);
     $this->supportsDenormalization([], self::ENTITY_CLASS, Argument::not(self::FORMAT_CSV))->shouldBe(false);
     $this->supportsDenormalization([], Argument::not(self::ENTITY_CLASS), Argument::not(self::FORMAT_CSV))->shouldBe(false);
 }
 function it_provides_the_color_and_font_color_for_the_given_channel($manager, ChannelInterface $channel, $colorsProvider)
 {
     $manager->getChannelByCode(Argument::not(null))->willReturn($channel);
     $channel->getColor()->willReturn('blue');
     $colorsProvider->getColorCode('blue')->willReturn('0,31,63,.4');
     $colorsProvider->getFontColor('blue')->willReturn('#ccc');
     $this->channelColor('test')->shouldReturn('0,31,63,.4');
     $this->channelFontColor('test')->shouldReturn('#ccc');
 }
 function it_does_not_mark_order_as_fulfilled_when_it_has_been_shipped_but_not_paid(FactoryInterface $stateMachineFactory, OrderInterface $order, StateMachineInterface $stateMachine)
 {
     $order->getShippingState()->willReturn(OrderShippingStates::STATE_SHIPPED);
     $order->getPaymentState()->willReturn(Argument::not(OrderPaymentStates::STATE_PAID));
     $stateMachineFactory->get($order, OrderTransitions::GRAPH)->willReturn($stateMachine);
     $stateMachine->can(OrderTransitions::TRANSITION_FULFILL)->willReturn(true);
     $stateMachine->apply(OrderTransitions::TRANSITION_FULFILL)->shouldNotBeCalled();
     $this->resolve($order);
 }
示例#4
0
 function it_uses_merged_definition_if_default_definition_exists_to_build_Token(TokenDefinition $defaultDefinition, TokenDefinition $definition, TokenDefinition $mergedDefinition, Token $token, TokenBuilder $builder)
 {
     $type = 'type';
     $defaultDefinition->merge($definition)->willReturn($mergedDefinition);
     $definition->getType()->willReturn($type);
     /**
      * $definition is created based on CLONED version of original, so it is not possible to
      * check if object passed as an argument is exactly the same. It is possible to checks
      * that it is not the usual one ($definition)
      */
     $builder->build(a::not($definition))->willReturn($token);
     $this->beConstructedWith($builder);
     $this->setDefaultDefinition($defaultDefinition)->addDefinition($definition)->build($type);
 }
 function it_does_not_change_object_media_because_the_image_does_not_be_an_media(ObjectEvent $event, ObjectStub $object)
 {
     $event->getObject()->shouldBeCalled()->willReturn($object);
     $object->getImage()->shouldBeCalled()->willReturn(Argument::not('Kreta\\Component\\Core\\Model\\Media'));
     $this->onChangeObjectMedia($event);
 }
示例#6
0
 function it_does_not_support_other_normalizations(CategoryInterface $category)
 {
     $this->supportsNormalization($category, 'csv')->shouldReturn(false);
     $this->supportsNormalization(Argument::not($category), 'xml')->shouldReturn(false);
     $this->supportsNormalization(Argument::not($category), 'json')->shouldReturn(false);
 }
 function it_processes_the_order(OrderUpdaterInterface $orderUpdater, OrderInterface $order)
 {
     $order->getState()->willReturn(Argument::not(OrderInterface::STATE_CANCELLED));
     $orderUpdater->update($order)->shouldBeCalled();
     $this->process($order);
 }
 function it_does_not_support_other_normalizations(AbstractAttribute $attribute)
 {
     $this->supportsNormalization($attribute, 'csv')->shouldReturn(false);
     $this->supportsNormalization(Argument::not($attribute), 'xml')->shouldReturn(false);
     $this->supportsNormalization(Argument::not($attribute), 'json')->shouldReturn(false);
 }
示例#9
0
 /**
  * @test
  * it should skip some options by default
  * @dataProvider skippedOptions
  */
 public function it_should_skip_some_options_by_default($option)
 {
     $this->config[$option] = true;
     $this->executor->exec(Argument::not(Argument::containingString('--' . $option)), Argument::any(), Argument::any())->shouldBeCalled();
     $sut = $this->make_instance();
     $sut->cli('core version');
 }
示例#10
0
 /**
  * @return ChapterTemplate[]
  */
 private function getTestChapterTemplates()
 {
     $startCondition = $this->prophesize(MessageCondition::class);
     $startCondition->isTrueFor(Argument::type(FileWasUploaded::class))->willReturn(true);
     $startCondition->isTrueFor(Argument::not(Argument::type(FileWasUploaded::class)))->willReturn(false);
     $isDoneCondition = $this->prophesize(MessageCondition::class);
     $isDoneCondition->isTrueFor(Argument::type(FileWasProcessed::class))->willReturn(true);
     $isDoneCondition->isTrueFor(Argument::not(Argument::type(FileWasProcessed::class)))->willReturn(false);
     $payloadGenerator = $this->prophesize(PayloadGenerator::class);
     $payloadGenerator->__invoke(Argument::any(), Argument::any(), Argument::any())->will(function ($args) {
         list($previousMessage, $payload, $metadata) = $args;
         $payload['filename'] = $previousMessage->payload()['filename'];
     });
     $commandTemplate = new MessageTemplate(ProcessFile::class, new FQCNMessageFactory(), [], [], $payloadGenerator->reveal());
     $chapterTemplate = new ChapterTemplate(ChapterName::fromString('File Processor'), $commandTemplate, $startCondition->reveal(), $isDoneCondition->reveal());
     return [$chapterTemplate];
 }
 function let(PaymentPlanCalculatorInterface $delegatedFooCalculator)
 {
     $delegatedFooCalculator->supportsDefinition('Foo')->willReturn(true);
     $delegatedFooCalculator->supportsDefinition(Argument::not('Foo'))->willReturn(false);
     $this->registerCalculator($delegatedFooCalculator);
 }
示例#12
0
 function it_does_not_support_other_normalizations(Family $family)
 {
     $this->supportsNormalization($family, 'csv')->shouldReturn(false);
     $this->supportsNormalization(Argument::not($family), 'xml')->shouldReturn(false);
     $this->supportsNormalization(Argument::not($family), 'json')->shouldReturn(false);
 }
 function its_query_when_the_specification_is_not_a_sql_user_specification()
 {
     $this->shouldThrow(new \InvalidArgumentException('This argument must be a SQLUserSpecification'))->during('query', [Argument::not('Infrastructure\\Persistence\\Sql\\Repository\\User\\SqlUserSpecification')]);
 }