コード例 #1
0
 function it_executes_post_endpoint_for_matching_commands(Extension $extension, Command $command, ServiceLocator $serviceLocator)
 {
     $extension->expands($command)->willReturn(true);
     $extension->post($command, $serviceLocator)->shouldBeCalled();
     $this->register($extension);
     $this->post($command, $serviceLocator);
 }
コード例 #2
0
 function it_execute_extension_points(Extension $extension)
 {
     $command = new AddToCart("SKU", 1, (string) CartId::generate());
     $extension->pre($command, Argument::type(ServiceLocator::class))->shouldBeCalled();
     $extension->post($command, Argument::type(ServiceLocator::class))->shouldBeCalled();
     $extension->expands($command)->willReturn(true);
     $this->registry->register($extension->getWrappedObject());
     $this->execute($command, function () {
     });
 }