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.

testInvokeWillCreateAMailerInstance()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 39
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 39
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 26
nc 1
nop 0
1
<?php
2
namespace RbCommentTest\Factory\Mvc\Controller\Plugin;
3
4
use Interop\Container\ContainerInterface;
5
use PHPUnit_Framework_TestCase;
6
use RbComment\Factory\Mvc\Controller\Plugin\MailerFactory;
7
use RbComment\Mvc\Controller\Plugin\Mailer;
8
use Zend\Mail\Transport\Sendmail;
9
10
final class MailerFactoryTest extends PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * @group factory
14
     */
15
    public function testInvokeWillCreateAMailerInstance()
16
    {
17
        $containerMock = $this->createMock(ContainerInterface::class);
18
19
        $viewHelperManagerMock =
20
            $this->getMockBuilder('ViewHelperManager')
21
                 ->setMethods(['get'])
22
                 ->getMock();
23
        $mailerMock            = $this->createMock(Sendmail::class);
24
        $configMock            = [uniqid()];
25
26
        $serverUrlMock = uniqid();
27
28
        $factory = new MailerFactory();
29
30
        // Expectations
31
        $containerMock->expects($this->exactly(3))
32
                      ->method('get')
33
                      ->withConsecutive(
34
                          ['ViewHelperManager'],
35
                          ['RbComment\Mailer'],
36
                          ['Config']
37
                      )
38
                      ->willReturnOnConsecutiveCalls(
39
                          $viewHelperManagerMock,
40
                          $mailerMock,
41
                          $configMock
42
                      );
43
44
        $viewHelperManagerMock->expects($this->once())
45
                              ->method('get')
46
                              ->with('serverUrl')
47
                              ->willReturn($serverUrlMock);
48
49
        $table = $factory($containerMock, Mailer::class);
50
51
        // Assertions
52
        $this->assertInstanceOf(Mailer::class, $table);
53
    }
54
}
55