Mockery\Container::fetchMock PHP Method

fetchMock() public method

Return a specific remembered mock according to the array index it was stored to in this container instance
public fetchMock ( $reference ) : Mock
return Mock
    public function fetchMock($reference)
    {
        if (isset($this->_mocks[$reference])) {
            return $this->_mocks[$reference];
        }
    }

Usage Example

Example #1
0
 /**
  * Static fetching of a mock associated with a name or explicit class poser
  */
 public static function fetchMock($name)
 {
     return self::$_container->fetchMock($name);
 }