Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4792921
WithConfiguration.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
WithConfiguration.php
View Options
<?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
\N
otifications
\P
habricator
\P
habricatorStory"
)
->
setConstructorArgs
([
"https://phab.acme"
])
->
getMock
();
}
private
function
attachProjectsToStoryMock
(
$mock
,
$projects
)
{
$mock
->
expects
(
$this
->
any
())
->
method
(
"getProjects"
)
->
will
(
$this
->
returnValue
(
$projects
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Feb 28, 21:39 (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2437714
Default Alt Text
WithConfiguration.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment