Page MenuHomeDevCentral

WithConfiguration.php
No OneTemporary

WithConfiguration.php

<?php
namespace Nasqueron\Notifications\Tests\Analyzers\Phabricator;
use Nasqueron\Notifications\Analyzers\Phabricator\PhabricatorPayloadAnalyzerConfiguration;
use Nasqueron\Notifications\Phabricator\PhabricatorStory;
/**
* Helper methods to construct needed objects
*/
trait WithConfiguration {
private function getPhabricatorPayloadAnalyzerConfiguration () {
$filename = __DIR__ . '/../../data/PhabricatorPayloadAnalyzer/Nasqueron.json';
$mapper = new \JsonMapper();
return $mapper->map(
json_decode(file_get_contents($filename)),
new PhabricatorPayloadAnalyzerConfiguration('Nasqueron')
);
}
private function getStory() {
return $this
->getMockBuilder("Nasqueron\Notifications\Phabricator\PhabricatorStory")
->setConstructorArgs(["https://phab.acme"])
->getMock();
}
private function attachProjectsToStoryMock ($mock, $projects) {
$mock
->expects($this->any())
->method("getProjects")
->will($this->returnValue($projects));
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Feb 28, 21:39 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2437714
Default Alt Text
WithConfiguration.php (1 KB)

Event Timeline