/**
  * @test
  */
 public function shouldAllowGetStorageForGivenClass()
 {
     $storageFooMock = $this->getMock('Payum\\Core\\Storage\\StorageInterface');
     $storageBarMock = $this->getMock('Payum\\Core\\Storage\\StorageInterface');
     $registry = new SimpleRegistry(array(), array('stdClass' => $storageFooMock, 'Payum\\Core\\Tests\\Mocks\\Model\\TestModel' => $storageBarMock));
     $this->assertSame($storageFooMock, $registry->getStorage('stdClass'));
     $this->assertSame($storageBarMock, $registry->getStorage('Payum\\Core\\Tests\\Mocks\\Model\\TestModel'));
 }
Example #2
0
 /**
  * @test
  */
 public function shouldAllowGetStorageForGivenClass()
 {
     $storageFooMock = $this->getMock(StorageInterface::class);
     $storageBarMock = $this->getMock(StorageInterface::class);
     $registry = new SimpleRegistry(array(), array('stdClass' => $storageFooMock, TestModel::class => $storageBarMock));
     $this->assertSame($storageFooMock, $registry->getStorage('stdClass'));
     $this->assertSame($storageBarMock, $registry->getStorage(TestModel::class));
 }