Beispiel #1
0
 public function createCart($sku)
 {
     $plan = $this->findBySku($sku);
     $order = new Model\Order();
     $order->attachProduct($plan);
     return $order;
 }
 public function testDeployHasFailed()
 {
     $order = new Order();
     $order->attachProduct(new Plan([]));
     $user = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserInterface');
     $order->authenticateWith($user);
     $order->makeItPaid([]);
     $order->createStack('dummy');
     $this->assertState('DeployInProgress', $order);
     $order->deploymentFailed();
     $this->assertState('Paid', $order);
 }
 /**
  * @depends testInquiry
  */
 public function testAttachProduct(Order $order)
 {
     $order->attachProduct(new Plan([]));
     $this->assertState('Cart', $order);
 }
 protected function assertState($state)
 {
     $this->assertInstanceOf('Trismegiste\\PortalBundle\\Model\\State\\' . $state, $this->order->getState());
 }