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.

test_pushing_event_to_queue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 44

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 44
rs 9.216
c 0
b 0
f 0
1
<?php declare (strict_types=1);
2
3
namespace Tests\EventDispatcher;
4
5
use Illuminate\Container\Container;
6
use Illuminate\Contracts\Config\Repository;
7
use Illuminate\Queue\Capsule\Manager as Queue;
8
use Illuminate\Support\Testing\Fakes\EventFake;
9
use SmoothPhp\LaravelAdapter\QueuedEventDispatcher\QueuedEventDispatcher;
10
use SmoothPhp\LaravelAdapter\QueuedEventDispatcher\QueuedEventHandler;
11
use SmoothPhp\Serialization\ObjectSelfSerializer;
12
use Tests\EventDispatcher\Helpers\TestEvent;
13
use Tests\EventDispatcher\Helpers\TestHandler;
14
15
/**
16
 * Class PushEventThoughDispatcherQueueTest
17
 * @package Tests\EventDispatcher
18
 * @author Simon Bennett <[email protected]>
19
 */
20
final class PushEventThoughDispatcherQueueTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     *
24
     */
25
    public function test_pushing_event_to_queue()
26
    {
27
        $container = new Container();
28
       // $container->bind(\Illuminate\Contracts\Container\Container::class, $container);
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
29
        $queue = new Queue($container);
30
31
32
        $queue->addConnection(
33
            [
34
                'driver' => 'sync',
35
            ]
36
        );
37
38
39
        $config = $this->getMockBuilder(Repository::class)->getMock();
40
        $config->method('set')->with(
41
            $this->returnValueMap(
42
                [
43
                    // Config set values
44
                ]
45
            )
46
        );
47
        $config->method('get')->will(
48
            $this->returnValueMap(
49
                [
50
                    // Config get values
51
                ]
52
            )
53
        );
54
        $eventDispatcher = new QueuedEventDispatcher($queue->getConnection(), new ObjectSelfSerializer(), $config);
55
56
        $handler = new TestHandler();
57
58
        $eventDispatcher->addSubscriber($handler);
59
        $eventDispatcher->addSubscriber($handler);
60
61
        $event = new TestEvent(uuid());
62
63
        //$this->assertEquals(2,$handler->runCount);
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
64
65
        $eventDispatcher->dispatch(strtr(get_class($event), '\\', '.'), [$event]);
66
67
68
    }
69
}
70