/** * @test */ public function shouldInitializeStorageExtensionsForEachStorageInRegistry() { $storageOneMock = $this->getMock('Payum\\Core\\Storage\\StorageInterface'); $storageTwoMock = $this->getMock('Payum\\Core\\Storage\\StorageInterface'); $storageThreeMock = $this->getMock('Payum\\Core\\Storage\\StorageInterface'); $paymentFooMock = $this->getMock('Payum\\Core\\PaymentInterface'); $paymentFooMock->expects($this->exactly(3))->method('addExtension'); $paymentBarMock = $this->getMock('Payum\\Core\\PaymentInterface'); $paymentBarMock->expects($this->exactly(3))->method('addExtension'); $registry = new SimpleRegistry(array('foo' => $paymentFooMock, 'bar' => $paymentBarMock), array('fooClass' => $storageOneMock, 'barClass' => $storageTwoMock, 'ololClass' => $storageThreeMock), 'foo'); $registry->getPayment('foo'); $registry->getPayment('bar'); }