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 ( 5543fb...d29718 )
by Andreas
03:19
created

CreateUpdatePublisherTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testPublish() 0 10 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaign\Test\Unit\MessageQueue\Contact;
7
8
9
use CommerceLeague\ActiveCampaign\MessageQueue\Contact\CreateUpdateMessage;
10
use CommerceLeague\ActiveCampaign\MessageQueue\Contact\CreateUpdatePublisher;
11
use Magento\Framework\MessageQueue\PublisherInterface;
12
use PHPUnit\Framework\MockObject\MockObject;
13
use PHPUnit\Framework\TestCase;
14
15
class CreateUpdatePublisherTest extends TestCase
16
{
17
    /**
18
     * @var MockObject|PublisherInterface
19
     */
20
    protected $publisher;
21
22
    /**
23
     * @var CreateUpdatePublisher
24
     */
25
    protected $createUpdatePublisher;
26
27
    protected function setUp()
28
    {
29
        $this->publisher = $this->createMock(PublisherInterface::class);
30
        $this->createUpdatePublisher = new CreateUpdatePublisher($this->publisher);
31
    }
32
33
    public function testPublish()
34
    {
35
        /** @var MockObject|CreateUpdateMessage $message */
36
        $message = $this->createMock(CreateUpdateMessage::class);
37
38
        $this->publisher->expects($this->once())
0 ignored issues
show
Bug introduced by
The method expects() does not exist on Magento\Framework\MessageQueue\PublisherInterface. ( Ignorable by Annotation )

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

38
        $this->publisher->/** @scrutinizer ignore-call */ 
39
                          expects($this->once())

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
            ->method('publish')
40
            ->with('activecampaign.contact.create_update', $message);
41
42
        $this->createUpdatePublisher->publish($message);
43
    }
44
}
45