diff --git a/tests/TestWorker.php b/tests/TestWorker.php new file mode 100644 index 0000000..d07a1ba --- /dev/null +++ b/tests/TestWorker.php @@ -0,0 +1,35 @@ +shouldReceive( 'pop' )->once()->andReturn( $job ); + + $worker = new Worker( $connection ); + $this->assertTrue( $worker->process() ); + } + + public function test_process_fail() { + $connection = Mockery::spy( ConnectionInterface::class ); + $job = Mockery::spy( Job::class ); + $connection->shouldReceive( 'pop' )->once()->andReturn( false ); + + $worker = new Worker( $connection ); + $this->assertFalse( $worker->process() ); + } +} \ No newline at end of file