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

AbstractManagerTest::get404Exception()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
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