setPaymentMethod() public method

public setPaymentMethod ( Sonata\Component\Payment\PaymentInterface $method = null )
$method Sonata\Component\Payment\PaymentInterface
 /**
  * @return void
  */
 public function testOrder()
 {
     $basket = new Basket();
     $customer = $this->getMock('Sonata\\Component\\Customer\\CustomerInterface');
     $billingAddress = $this->getMock('Sonata\\Component\\Customer\\AddressInterface');
     $deliveryMethod = $this->getMock('Sonata\\Component\\Delivery\\ServiceDeliveryInterface');
     $deliveryMethod->expects($this->exactly(2))->method('isAddressRequired')->will($this->returnValue(true));
     $deliveryAddress = $this->getMock('Sonata\\Component\\Customer\\AddressInterface');
     $paymentMethod = $this->getMock('Sonata\\Component\\Payment\\PaymentInterface');
     $basket->setCustomer($customer);
     $basket->setBillingAddress($billingAddress);
     $basket->setDeliveryMethod($deliveryMethod);
     $basket->setDeliveryAddress($deliveryAddress);
     $basket->setPaymentMethod($paymentMethod);
     $currency = new Currency();
     $currency->setLabel('EUR');
     $basket->setCurrency($currency);
     $order = $this->getBasketTransform()->transformIntoOrder($basket);
     $this->assertInstanceOf('Sonata\\Component\\Order\\OrderInterface', $order, '::transformIntoOrder() returns an OrderInstance object');
 }