__construct() public method

Set the namespace, function name and the mock function.
public __construct ( string $namespace, string $name, callable $function )
$namespace string The namespace for the mock function.
$name string The function name of the mocked function.
$function callable The mock function.
コード例 #1
0
ファイル: Spy.php プロジェクト: php-mock/php-mock
 /**
  * Initializes the spy.
  *
  * If no function is specified it will use the existing function.
  *
  * @param string        $namespace The namespace for the mock function.
  * @param string        $name      The function name of the mocked function.
  * @param callable|null $function  The mock function, or null for using the existing function.
  */
 public function __construct($namespace, $name, callable $function = null)
 {
     parent::__construct($namespace, $name, $function ?: $name);
 }