Exemplo n.º 1
0
 public function setUp()
 {
     $session = new Session(new MockArraySessionStorage());
     $dispatcher = $this->getMock("Symfony\\Component\\EventDispatcher\\EventDispatcherInterface");
     $this->request = new Request();
     $this->request->setSession($session);
     $this->securityContext = new SecurityContext($this->request);
     $this->container = new ContainerBuilder();
     $this->container->set("event_dispatcher", $dispatcher);
     $this->container->set('request', $this->request);
     $this->orderEvent = new OrderEvent(new OrderModel());
     $this->orderEvent->setDispatcher($dispatcher);
     // public function __construct(Request $this->request, ParserInterface $parser, MailerFactory $mailer, SecurityContext $securityContext)
     $mailerFactory = new MailerFactory($dispatcher, new SmartyParser($this->request, $dispatcher, new ParserContext($this->request)));
     $this->orderAction = new Order($this->request, $mailerFactory, $this->securityContext);
     /* load customer */
     $this->customer = $this->loadCustomer();
     if (null === $this->customer) {
         return;
     }
     /* fill cart */
     $this->cart = $this->fillCart();
 }