Completed
Push — master ( 07aa67...ce71ee )
by Michael
03:29
created

CodebaseNotifierTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 2
cbo 4
dl 0
loc 28
rs 10
1
<?php
2
3
namespace ParityBit\DeploymentNotifier\Notifiers;
4
5
use ParityBit\DeploymentNotifier\Clients\CodebaseClient;
6
use ParityBit\DeploymentNotifier\Deployment;
7
8
class CodebaseNotifierTest extends \PHPUnit_Framework_TestCase
9
{
10
    protected $faker;
11
12
    public function setUp()
13
    {
14
        $this->faker = \Faker\Factory::create();
15
    }
16
17
    public function testNotifyOfDeployment()
18
    {
19
        $deployment = $this->getMockBuilder(Deployment::class)
20
                           ->disableOriginalConstructor()
21
                           ->getMock();
22
23
        $client = $this->getMockBuilder(CodebaseClient::class)
24
                       ->disableOriginalConstructor()
25
                       ->setMethods(['registerDeployment'])
26
                       ->getMock();
27
28
        $client->expects($this->once())
29
               ->method('registerDeployment')
30
               ->with($this->equalTo($deployment));
31
32
        $notifier = new CodebaseNotifier($client);
33
        $notifier->notifyOfDeployment($deployment);
34
    }
35
}
36