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

CodebaseNotifierTest::testNotifyOfDeployment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

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