public function setUp() { $this->pump = $this->getMock('phalanx\\tasks\\TaskPump', array('_Exit')); tasks\TaskPump::T_set_pump($this->pump); $this->handler = new tasks\UnitTestOutputHandler(); $this->pump->set_output_handler($this->handler); }
public function setUp() { $this->handler = new tasks\ViewOutputHandler(); $this->pump = $this->getMock('phalanx\\tasks\\TaskPump', array('_Exit')); tasks\TaskPump::T_set_pump($this->pump); $this->tpl_path = TestView::template_path(); $this->cache_path = TestView::cache_path(); }
public function testCancel() { $task = new TestTask(); $pump = $this->getMock('phalanx\\tasks\\TaskPump'); $pump->expects($this->once())->method('Cancel')->with($task); \phalanx\tasks\TaskPump::T_set_pump($pump); $this->assertFalse($task->is_cancelled()); $task->Cancel(); }
public function testSharedPump() { // Reset. TaskPump::T_set_pump(NULL); $this->assertNotNull(TaskPump::Pump(), 'Did not create shared pump.'); $this->assertNotSame($this->pump, TaskPump::Pump()); TaskPump::set_pump($this->pump); $this->assertSame($this->pump, TaskPump::Pump()); }