| 1 | <?php |
||
| 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 |