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.

MailDefinitionProviderSymfonyTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testFetchDefinitionResolvesProperlyAndFetchesXml() 0 7 1
A testResourceFormatWithoutBundleNameThrowsException() 0 4 1
1
<?php
2
3
namespace Hautzi\SystemMailBundle\Tests\SystemMailer\MailDefinition;
4
5
use Hautzi\SystemMailBundle\SystemMailer\MailDefinition\MailDefinitionProviderSymfony;
6
use Symfony\Component\HttpKernel\KernelInterface;
7
8
class MailDefinitionProviderSymfonyTest extends \PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * @var MailDefinitionProviderSymfony
12
     */
13
    protected $fixture;
14
15
    /**
16
     * @var KernelInterface
17
     */
18
    protected $kernel;
19
20
    /**
21
     * @var \Twig_Environment
22
     */
23
    protected $twig;
24
25
    protected function setUp()
26
    {
27
        $this->kernel = $this->prophesize(KernelInterface::class);
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->prophesize(\Symfo...KernelInterface::class) of type object<Prophecy\Prophecy\ObjectProphecy> is incompatible with the declared type object<Symfony\Component...Kernel\KernelInterface> of property $kernel.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
28
        $this->twig = $this->prophesize(\Twig_Environment::class);
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->prophesize(\Twig_Environment::class) of type object<Prophecy\Prophecy\ObjectProphecy> is incompatible with the declared type object<Twig_Environment> of property $twig.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
29
30
        $this->fixture = new MailDefinitionProviderSymfony($this->kernel->reveal(), $this->twig->reveal());
31
    }
32
33
    public function testFetchDefinitionResolvesProperlyAndFetchesXml()
34
    {
35
        $this->kernel->locateResource('@AppBundle/Resources/emails/path/to/mail.xml.twig')->willReturn('/path/to/mail.xml.twig')->shouldBeCalled();
0 ignored issues
show
Bug introduced by
The method willReturn cannot be called on $this->kernel->locateRes...path/to/mail.xml.twig') (of type string|array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
36
        $this->twig->render('/path/to/mail.xml.twig', ['param1' => 'wuhuuuu'])->willReturn('<email></email>')->shouldBeCalled();
37
38
        $this->assertEquals('<email></email>', $this->fixture->fetchMailDefinition('App:path/to/mail', ['param1' => 'wuhuuuu']));
39
    }
40
41
    /**
42
     * @expectedException \InvalidArgumentException
43
     */
44
    public function testResourceFormatWithoutBundleNameThrowsException()
45
    {
46
        $this->fixture->fetchMailDefinition('path/to/mail', ['param1' => 'wuhuuuu']);
47
    }
48
}
49