예제 #1
0
 /**
  * Handle to flush the cache content through the injected cache proxy.
  * @param \Brickoo\Component\Messaging\Message $message
  * @return void
  */
 public function handleFlushMessage(Message $message)
 {
     if ($message instanceof FlushMessage) {
         $this->storageProxy->flush();
     }
 }
예제 #2
0
 /**
  * @covers Brickoo\Component\Storage\StorageProxy::get
  * @covers Brickoo\Component\Storage\StorageProxy::getAdapter
  * @covers Brickoo\Component\Storage\StorageProxy::getReadyAdapter
  * @covers Brickoo\Component\Storage\StorageProxy::executeIterationCallback
  */
 public function testGetAdapterUsesFirstReadyAdapter()
 {
     $storageIdentifier = "someId";
     $storageContent = "some content";
     $adapterExpected = $this->getAdapterStub();
     $adapterExpected->expects($this->once())->method("get")->with($storageIdentifier)->will($this->returnValue($storageContent));
     $adapterUnexpected = $this->getAdapterStub();
     $storageProxy = new StorageProxy($this->getAdapterPoolIterator([$adapterExpected, $adapterUnexpected]));
     $this->assertEquals($storageContent, $storageProxy->get($storageIdentifier));
 }