GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( a7fd0e...bf58f3 )
by Andreas
04:02
created

ContactRequestBuilderTest::testBuild()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 22
dl 0
loc 31
rs 9.568
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace CommerceLeague\ActiveCampaign\Test\Unit\Gateway\Request;
4
5
use CommerceLeague\ActiveCampaign\Gateway\Request\ContactRequestBuilder;
6
use Magento\Customer\Model\Customer;
7
use PHPUnit\Framework\MockObject\MockObject;
8
use PHPUnit\Framework\TestCase;
9
10
/**
11
 */
12
class ContactRequestBuilderTest extends TestCase
13
{
14
    /**
15
     * @var MockObject|Customer
16
     */
17
    protected $customer;
18
19
    /**
20
     * @var ContactRequestBuilder
21
     */
22
    protected $contactRequestBuilder;
23
24
    protected function setUp()
25
    {
26
        $this->customer = $this->createMock(Customer::class);
27
        $this->contactRequestBuilder = new ContactRequestBuilder();
28
    }
29
30
    public function testBuild()
31
    {
32
        $email = '[email protected]';
33
        $firstName = 'John';
34
        $lasName = 'Doe';
35
36
        $this->customer->expects($this->at(0))
37
            ->method('getData')
0 ignored issues
show
Bug introduced by
The method method() does not exist on PHPUnit\Framework\MockObject\MockObject. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
            ->/** @scrutinizer ignore-call */ method('getData')

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
            ->with('email')
0 ignored issues
show
Bug introduced by
The method with() does not exist on PHPUnit\Framework\MockObject\MockObject. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
            ->/** @scrutinizer ignore-call */ with('email')

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
            ->willReturn($email);
0 ignored issues
show
Bug introduced by
The method willReturn() does not exist on PHPUnit\Framework\MockObject\MockObject. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
            ->/** @scrutinizer ignore-call */ willReturn($email);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
40
41
        $this->customer->expects($this->at(1))
42
            ->method('getData')
43
            ->with('firstname')
44
            ->willReturn($firstName);
45
46
        $this->customer->expects($this->at(2))
47
            ->method('getData')
48
            ->with('lastname')
49
            ->willReturn($lasName);
50
51
        $this->customer->expects($this->exactly(3))
52
            ->method('getData');
53
54
        $this->assertEquals(
55
            [
56
                'email' => $email,
57
                'firstName' => $firstName,
58
                'lastName' => $lasName
59
            ],
60
            $this->contactRequestBuilder->build($this->customer)
61
        );
62
    }
63
}
64