CIPHPUnitTestCase::getDouble PHP Method

getDouble() public method

$email = $this->getMockBuilder('CI_Email') ->setMethods(['send']) ->getMock(); $email->method('send')->willReturn(TRUE); will be $email = $this->getDouble('CI_Email', ['send' => TRUE]);
public getDouble ( string $classname, array $params, boolean $enable_constructor = false ) : object
$classname string
$params array [method_name => return_value]
$enable_constructor boolean enable constructor or not
return object PHPUnit mock object
    public function getDouble($classname, $params, $enable_constructor = false)
    {
        return $this->double->getDouble($classname, $params, $enable_constructor);
    }