DummyJob   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 4 1
A getPrefix() 0 4 1
A getName() 0 4 1
1
<?php
2
namespace Message;
3
4
5
use Tavii\SQSJobQueue\Message\Message;
6
use Tavii\SQSJobQueue\Job\booelan;
7
use Tavii\SQSJobQueue\Job\Job;
8
9
class MessageTest extends \PHPUnit_Framework_TestCase
10
{
11
    /**
12
     * @test
13
     */
14
    public function メッセージオブジェクトを生成することができる()
15
    {
16
        $job = new DummyJob(array('test' => '1'));
17
        $args = array(
18
            1 => 'test'
19
        );
20
        $queueUrl = '/path/to/url';
21
        $message = new Message($args, $job, $queueUrl);
22
        $this->assertEquals($job, $message->getJob());
23
        $this->assertInternalType('array', $message->getMessage());
24
        $this->assertEquals($args, $message->getMessage());
25
        $this->assertEquals($queueUrl, $message->getQueueUrl());
26
    }
27
}
28
29
class DummyJob extends Job
30
{
31
    /**
32
     * @param array $args
33
     * @return booelan
0 ignored issues
show
Documentation introduced by
Should the return type not be boolean?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
34
     */
35
    protected function run()
36
    {
37
        return true;
38
    }
39
40
    public function getPrefix()
41
    {
42
        return 'message_test';
43
    }
44
45
46
    /**
47
     * @return string
48
     */
49
    public function getName()
50
    {
51
        return 'dummy_job';
52
    }
53
54
}