getByTag() public method

Finds and returns all cache entries which are tagged by the specified tag.
public getByTag ( string $tag ) : array
$tag string The tag to search for
return array An array with the identifier (key) and content (value) of all matching entries. An empty array if no entries matched
 /**
  * @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');
 }