protected function fetchResult( $key, &$success ) {
if ( array_key_exists( $key, $this->cache ) ) {
protected function fetchResult( $key, &$success ) {
if ( array_key_exists( $key, $this->cache ) ) {
/**
* The memoized callable should relate inputs to outputs in the same
* way as the original underlying callable.
*/
public function testReturnValuePassedThrough() {
/**
* The memoized callable should relate inputs to outputs in the same
* way as the original underlying callable.
*/
public function testReturnValuePassedThrough() {
* Consecutive calls to the memoized callable with the same arguments
* should result in just one invocation of the underlying callable.
*
* Consecutive calls to the memoized callable with the same arguments
* should result in just one invocation of the underlying callable.
*
$observer->expects( $this->once() )
->method( 'computeSomething' )
->will( $this->returnValue( 'ok' ) );
$observer->expects( $this->once() )
->method( 'computeSomething' )
->will( $this->returnValue( 'ok' ) );
$this->readAttribute( $a, 'callableName' ),
$this->readAttribute( $b, 'callableName' )
);
$this->readAttribute( $a, 'callableName' ),
$this->readAttribute( $b, 'callableName' )
);