public function testWorkJob() { try { PHPQueue\Base::workJob(null, null); $this->fail("Should not be able to work the Job"); } catch (Exception $ex) { $this->assertStringStartsWith("Invalid worker object", $ex->getMessage()); } $worker = PHPQueue\Base::getWorker('Sample'); try { PHPQueue\Base::workJob($worker, null); $this->fail("Should not be able to work the Job"); } catch (Exception $ex) { $this->assertStringStartsWith("Invalid job object", $ex->getMessage()); } $job = new PHPQueue\Job(); $job->worker = 'Sample'; $job->data = array('var1' => 'Hello, world!'); $result = PHPQueue\Base::workJob($worker, $job); $this->assertEquals(array('var1' => 'Hello, world!', 'var2' => "Welcome back!"), $result->result_data); $this->assertEquals(\PHPQueue\Job::OK, $job->status); $this->assertTrue($job->isSuccessful()); }