TestJob::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Tavii\SQSJobQueue\Job;
3
4
5
class JobTest extends \PHPUnit_Framework_TestCase
6
{
7
    /**
8
     * @test
9
     */
10
    public function ジョブを生成することができる()
11
    {
12
        $args = array('1' => 'a', 'b' => '3');
13
        $job = new TestJob($args);
14
        $this->assertEquals("Tavii\\SQSJobQueue\\Job\\TestJob",$job->getClassName());
15
        $this->assertEquals("test_job", $job->getName());
16
        $this->assertInternalType('array', $job->getArgs());
17
        $this->assertEquals($args, $job->getArgs());
18
    }
19
}
20
21
class TestJob extends Job
22
{
23
24
    public function getName()
25
    {
26
        return 'test_job';
27
    }
28
29
    public function getPrefix()
30
    {
31
        return 'job_test';
32
    }
33
34
35
    public function run()
36
    {
37
        return true;
38
    }
39
}