/**
  * 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();
     }
 }
Esempio n. 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));
 }