public function testRun() { $this->storage->clear(); $this->scheduler->schedule(new Task('test', 'workload')); $this->scheduler->run(); $scheduled = $this->storage->findScheduled(); $this->assertCount(0, $scheduled); $all = $this->storage->findAll(); $this->assertCount(1, $all); $this->assertEquals('test', $all[0]->getTaskName()); $this->assertEquals('workload', $all[0]->getWorkload()); $this->assertTrue($all[0]->isCompleted()); $this->assertEquals('daolkrow', $all[0]->getResult()); }
/** * {@inheritdoc} */ public function schedule() { $this->scheduler->schedule($this->task); }