Kraken\_Unit\Runtime\Command\_T\TCommand::createRuntime PHP Method

createRuntime() public method

public createRuntime ( string[] | null $methods = [] ) : Kraken\Runtime\RuntimeContainerInterface | PHPUnit_Framework_MockObject_MockObject
$methods string[] | null
return Kraken\Runtime\RuntimeContainerInterface | PHPUnit_Framework_MockObject_MockObject
    public function createRuntime($methods = [])
    {
        $methods = array_merge($methods, ['getManager', 'getCore']);
        $manager = $this->getMock(RuntimeManagerInterface::class, [], [], '', false);
        $core = $this->getMock(Core::class, ['make'], []);
        $core->expects($this->any())->method('make')->will($this->returnValue(null));
        $runtime = $this->getMock(RuntimeContainer::class, $methods, ['parent', 'alias', 'name']);
        $runtime->expects($this->any())->method('getManager')->will($this->returnValue($manager));
        $runtime->expects($this->any())->method('getCore')->will($this->returnValue($core));
        if ($this->cmd !== null) {
            $this->setProtectedProperty($this->cmd, 'runtime', $runtime);
        }
        $this->manager = $manager;
        $this->runtime = $runtime;
        $this->core = $core;
        return $runtime;
    }