コード例 #1
0
 /**
  * @test
  */
 public function shouldInitializeStorageExtensionsOnGetPayments()
 {
     $storageOneMock = $this->getMock('Payum\\Core\\Storage\\StorageInterface');
     $paymentFooMock = $this->getMock('Payum\\Core\\PaymentInterface');
     $paymentFooMock->expects($this->once())->method('addExtension');
     $paymentBarMock = $this->getMock('Payum\\Core\\PaymentInterface');
     $paymentBarMock->expects($this->once())->method('addExtension');
     $registry = new SimpleRegistry(array('foo' => $paymentFooMock, 'bar' => $paymentBarMock), array('fooClass' => $storageOneMock), 'foo');
     $registry->getPayments();
     $registry->getPayments();
 }
コード例 #2
0
    /**
     * @test
     */
    public function shouldNotInitializeStorageExtensionsOnGetPaymentsIfNotGenericPayment()
    {
        $storageOneMock = $this->getMock('Payum\Core\Storage\StorageInterface');

        $paymentFooMock = $this->getMock('Payum\Core\PaymentInterface');

        $paymentBarMock = $this->getMock('Payum\Core\Payment');

        $registry = new SimpleRegistry(
            array('foo' => $paymentFooMock, 'bar' => $paymentBarMock),
            array(
                'fooClass' => $storageOneMock,
            )
        );

        $registry->getPayments();
    }