// Set a key present on the second and the third (for get), those two will
// be different, this will ensure from where we get the key.
$this->secondBackend->
set('t23', 232
);
$this->thirdBackend->
set('t23', 233
);
// Set a key on only the third, we will ensure propagation using this one.
$this->thirdBackend->
set('t3', 33
);
// Create the chain.
$this->chain =
new BackendChain();
$this->chain
->
appendBackend($this->firstBackend
) ->
appendBackend($this->secondBackend
) ->
appendBackend($this->thirdBackend
);
} /**
* Tests the get feature.
*/
public function testGet() { $cached =
$this->chain->
get('t123'
);
$this->
assertNotFalse($cached, 'Got key that is on all backends'
);
$this->
assertSame(1231,
$cached->data, 'Got the key from the backend 1'
);