Completed
Push — master ( 4a5840...1f0278 )
by
unknown
11s
created

WebhookListTest::testGetWebhookPagination()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Moip\Tests\Resource;
4
5
use Moip\Helper\Pagination;
6
use Moip\Tests\TestCase;
7
8
class WebhookListTest extends TestCase
9
{
10
    public function testGetWebhookNoFilter()
11
    {
12
        $this->mockHttpSession($this->body_list_webhook_no_filter);
0 ignored issues
show
Bug introduced by
The property body_list_webhook_no_filter does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
13
        $webhooks = $this->moip->webhooks()->get();
14
15
        $this->assertNotEmpty($webhooks->getWebhooks());
16
    }
17
18 View Code Duplication
    public function testGetWebhookPagination()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
    {
20
        $this->mockHttpSession($this->body_list_webhook_pagination);
0 ignored issues
show
Bug introduced by
The property body_list_webhook_pagination does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
21
        $webhooks = $this->moip->webhooks()->get(new Pagination(100, 0));
22
23
        $this->assertNotEmpty($webhooks->getWebhooks());
24
    }
25
26 View Code Duplication
    public function testGetWebhookParams()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        $this->mockHttpSession($this->body_list_webhook_all_filters);
0 ignored issues
show
Bug introduced by
The property body_list_webhook_all_filters does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
29
        $webhooks = $this->moip->webhooks()->get(new Pagination(10, 0), 'ORD-EE5XP23RMLSS', 'ORDER.PAID');
30
31
        $this->assertNotEmpty($webhooks->getWebhooks());
32
    }
33
}
34