/** * @test */ public function getByTagCallsBackendAndReturnsIdentifiersAndValuesOfEntries() { $tag = 'sometag'; $identifiers = ['one', 'two']; $entries = ['one' => 'one value', 'two' => 'two value']; $backend = $this->prepareDefaultBackend(); $backend->expects($this->once())->method('findIdentifiersByTag')->with($this->equalTo($tag))->will($this->returnValue($identifiers)); $backend->expects($this->exactly(2))->method('get')->will($this->onConsecutiveCalls('one value', 'two value')); $cache = new StringFrontend('StringFrontend', $backend); $this->assertEquals($entries, $cache->getByTag($tag), 'Did not receive the expected entries'); }