self() public method

Retrieve the last remembered mock object, which is the same as saying retrieve the current mock being programmed where you have yet to call mock() to change it - thus why the method name is "self" since it will be be used during the programming of the same mock.
public self ( ) : Mock
return Mock
示例#1
0
 /**
  * Static shortcut to \Mockery\Container::self()
  *
  * @return \Mockery\MockInterface
  */
 public static function self()
 {
     if (is_null(self::$_container)) {
         throw new \LogicException("You have not declared any mocks yet");
     }
     return self::$_container->self();
 }