public function testExecuteCommand() { foreach ($this->argList as $arg => $value) { $this->input->shouldReceive("getArgument")->withArgs([$arg])->once()->andReturn($value); } $this->runnerFactory->shouldReceive("createRunner")->withArgs([$this->argList["type"], "", $this->argList["maxRunCount"]])->once(); $this->runner->shouldReceive("execute")->withArgs([$this->argList["threadCommand"]])->once(); $command = new ThreadCommand("thread:command", $this->runnerFactory); $command->execute($this->input, $this->output); }
public function setup() { $this->runner = \Mockery::mock("Silktide\\Teamster\\Pool\\Runner\\RunnerInterface"); $this->runnerFactory = \Mockery::mock("Silktide\\Teamster\\Pool\\Runner\\RunnerFactory"); $this->runnerFactory->shouldReceive("createRunner")->andReturn($this->runner); $this->pid = \Mockery::mock("Silktide\\Teamster\\Pool\\Pid\\PidInterface")->shouldIgnoreMissing(true); $this->pidFactory = \Mockery::mock("Silktide\\Teamster\\Pool\\Pid\\PidFactoryInterface"); $this->pidFactory->shouldReceive("create")->andReturn($this->pid); $this->inputDefinition = \Mockery::mock("Symfony\\Component\\Console\\Input\\InputDefinition"); $this->input = \Mockery::mock("Symfony\\Component\\Console\\Input\\InputInterface"); $this->output = \Mockery::mock("Symfony\\Component\\Console\\Output\\OutputInterface")->shouldIgnoreMissing(); vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(new vfsStreamDirectory($this->testDir)); }
public function setup() { $this->runner = \Mockery::mock("Silktide\\Teamster\\Pool\\Runner\\RunnerInterface")->shouldIgnoreMissing(); $this->runner->shouldReceive("isRunning")->andReturn(true); $this->completedRunner = \Mockery::mock("Silktide\\Teamster\\Pool\\Runner\\RunnerInterface")->shouldIgnoreMissing(); $this->completedRunner->shouldReceive("isRunning")->andReturn(false); $this->runnerFactory = \Mockery::mock("Silktide\\Teamster\\Pool\\Runner\\RunnerFactory"); $this->runnerFactory->shouldReceive("createRunner")->withArgs(["console", "/^(?!completed-).*/", \Mockery::type("int")])->andReturn($this->runner); $this->runnerFactory->shouldReceive("createRunner")->withArgs(["console", "/^completed-/", \Mockery::type("int")])->andReturn($this->completedRunner); $this->pid = \Mockery::mock("Silktide\\Teamster\\Pool\\Pid\\PidInterface")->shouldIgnoreMissing(true); $this->pidFactory = \Mockery::mock("Silktide\\Teamster\\Pool\\Pid\\PidFactoryInterface"); $this->pidFactory->shouldReceive("create")->andReturn($this->pid); $this->inputDefinition = \Mockery::mock("Symfony\\Component\\Console\\Input\\InputDefinition"); $this->input = \Mockery::mock("Symfony\\Component\\Console\\Input\\InputInterface"); $this->output = \Mockery::mock("Symfony\\Component\\Console\\Output\\OutputInterface")->shouldIgnoreMissing(); }