sendbank() public method

public sendbank ( Sonata\Component\Order\OrderInterface $order )
$order Sonata\Component\Order\OrderInterface
Example #1
0
 public function testSendbank()
 {
     $date = new \DateTime();
     $date->setTimeStamp(strtotime('30/11/1981'));
     $date->setTimezone(new \DateTimeZone('Europe/Paris'));
     $order = new CheckPaymentTest_Order();
     $order->setCreatedAt($date);
     $router = $this->getMock('Symfony\\Component\\Routing\\RouterInterface');
     $router->expects($this->exactly(2))->method('generate')->will($this->returnValue('http://foo.bar/ok-url'));
     $logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');
     $client = $this->getMock('Buzz\\Client\\ClientInterface');
     $client->expects($this->once())->method('send')->will($this->returnCallback(function ($request, $response) {
         $response->setContent('ok');
     }));
     $browser = new Browser($client);
     $payment = new CheckPayment($router, $logger, $browser);
     $response = $payment->sendbank($order);
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
     $this->assertEquals(302, $response->getStatusCode());
     $this->assertEquals('http://foo.bar/ok-url', $response->headers->get('Location'));
     $this->assertFalse($response->isCacheable());
 }