Completed
Push — master ( 4ddcf1...47e4ec )
by
unknown
83:02 queued 43:05
created

MongoConnectorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConnect() 0 18 1
1
<?php
2
3
namespace SfCod\QueueBundle\Tests\Connector;
4
5
use PHPUnit\Framework\TestCase;
6
use SfCod\QueueBundle\Base\JobResolverInterface;
7
use SfCod\QueueBundle\Base\MongoDriverInterface;
8
use SfCod\QueueBundle\Connector\MongoConnector;
9
use SfCod\QueueBundle\Queue\MongoQueue;
10
11
/**
12
 * Class MongoConnectorTest
13
 * @author Virchenko Maksim <[email protected]>
14
 * @package SfCod\QueueBundle\Tests\Connector
15
 */
16
class MongoConnectorTest extends TestCase
17
{
18
    /**
19
     * Test connect
20
     */
21
    public function testConnect()
22
    {
23
        $jobResolver = $this->createMock(JobResolverInterface::class);
24
        $mongoDriver = $this->createMock(MongoDriverInterface::class);
25
26
        $connector = new MongoConnector($jobResolver, $mongoDriver);
27
28
        $config = [
29
            'collection' => uniqid('collection_'),
30
            'queue' => uniqid('queue_'),
31
            'expire' => rand(1, 1000),
32
            'limit' => rand(1, 10),
33
        ];
34
35
        $queue = $connector->connect($config);
36
37
        $this->assertInstanceOf(MongoQueue::class, $queue);
38
    }
39
}