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 ( f38fe1...5e4d8b )
by Yann
7s
created

DoctrineSpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace spec\Knp\Rad\DomainEvent\Dispatcher;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
8
use Knp\Rad\DomainEvent\Provider;
9
use Doctrine\ORM\Event\LifecycleEventArgs;
10
use Doctrine\ORM\Event\PostFlushEventArgs;
11
use Knp\Rad\DomainEvent\Event;
12
13
class DoctrineSpec extends ObjectBehavior
14
{
15
    function let(EventDispatcherInterface $dispatcher) {
16
        $this->beConstructedWith($dispatcher);
17
    }
18
19
    function it_is_initializable()
20
    {
21
        $this->shouldHaveType('Knp\Rad\DomainEvent\Dispatcher\Doctrine');
22
    }
23
24 View Code Duplication
    function it_pops_events_of_a_post_persisted_entity(
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...
25
        LifecycleEventArgs $event,
26
        Provider $entity,
27
        PostFlushEventArgs $postFlushEvent,
28
        Event $raisedEvent,
29
        $dispatcher
30
    ) {
31
        $event->getEntity()->willReturn($entity);
32
        $entity->popEvents()->willReturn([$raisedEvent]);
33
34
        $raisedEvent->setSubject($entity)->shouldBeCalled();
35
        $raisedEvent->getName()->willReturn('FooEvent');
36
        $dispatcher->dispatch('FooEvent', $raisedEvent)->shouldBeCalled();
37
38
        $this->postPersist($event);
39
        $this->postFlush($postFlushEvent);
40
    }
41
42 View Code Duplication
    function it_pops_events_of_a_post_loaded_entity(
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...
43
        LifecycleEventArgs $event,
44
        Provider $entity,
45
        PostFlushEventArgs $postFlushEvent,
46
        Event $raisedEvent,
47
        $dispatcher
48
    ) {
49
        $event->getEntity()->willReturn($entity);
50
        $entity->popEvents()->willReturn([$raisedEvent]);
51
52
        $raisedEvent->setSubject($entity)->shouldBeCalled();
53
        $raisedEvent->getName()->willReturn('FooEvent');
54
        $dispatcher->dispatch('FooEvent', $raisedEvent)->shouldBeCalled();
55
56
        $this->postLoad($event);
57
        $this->postFlush($postFlushEvent);
58
    }
59
60
    function it_doesnt_dispatch_events_of_non_provider_entities(
61
        LifecycleEventArgs $event,
62
        \StdClass $entity,
63
        PostFlushEventArgs $postFlushEvent,
64
        Event $raisedEvent,
65
        $dispatcher
66
    ) {
67
        $event->getEntity()->willReturn($entity);
68
        $dispatcher->dispatch(Argument::any(), $raisedEvent)->shouldNotBeCalled();
69
70
        $this->postPersist($event);
71
        $this->postFlush($postFlushEvent);
72
    }
73
}
74