Completed
Push — master ( 627c37...9fcd11 )
by Olivier
03:49 queued 01:55
created

AbstractManagerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 26
rs 10
1
<?php
2
3
namespace Ola\RabbitMqAdminToolkitBundle\Tests\Manager;
4
5
abstract class AbstractManagerTest extends \PHPUnit_Framework_TestCase
6
{
7
    protected $configuration;
8
    protected $client;
9
10
    public function setUp()
11
    {
12
        $this->client = $this->prophesize('RabbitMq\ManagementApi\Client');
13
14
        $this->configuration = $this->prophesize('Ola\RabbitMqAdminToolkitBundle\VhostConfiguration');
15
        $this->configuration->getClient()->willReturn($this->client->reveal());
16
        $this->configuration->getName()->willReturn('vhost');
17
18
    }
19
20
    protected function get404Exception()
21
    {
22
        $response = $this->prophesize('Guzzle\Http\Message\Response');
23
        $response->getStatusCode()->willReturn(404);
24
25
        $exception = $this->prophesize('Guzzle\Http\Exception\ClientErrorResponseException');
26
        $exception->getResponse()->willReturn($response->reveal());
27
28
        return $exception;
29
    }
30
}
31