Page MenuHomeDevCentral

NotifyNewCommitsToDiffusionTest.php
No OneTemporary

NotifyNewCommitsToDiffusionTest.php

<?php
namespace Nasqueron\Notifications\Tests\Jobs;
use Nasqueron\Notifications\Jobs\NotifyNewCommitsToDiffusion;
use Nasqueron\Notifications\Phabricator\PhabricatorAPI;
use Nasqueron\Notifications\Tests\TestCase;
use Mockery;
class NotifyNewCommitsToDiffusionTest extends TestCase {
/**
* Mock for the Phabricator API factory
* @var \Mockery\MockInterface
*/
private $apiFactoryMock;
/**
* The job to test
* @var NotifyNewCommitsToDiffusion
*/
private $job;
public function setUp () {
parent::setUp();
$this->apiFactoryMock = $this->mockPhabricatorAPI();
$this->job = $this->mockJob();
}
/**
* @return NotifyNewCommitsToDiffusion
*/
protected function mockJob() {
return new NotifyNewCommitsToDiffusion("acme", "ssh://acme/k2.git");
}
public function testJobWantsPhabricatorAPI () {
$this->apiFactoryMock->shouldReceive('getForProject')->once();
$this->job->handle();
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Feb 28, 21:45 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2437427
Default Alt Text
NotifyNewCommitsToDiffusionTest.php (1016 B)

Event Timeline