Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4793788
PhabricatorPayloadAnalyzerTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorPayloadAnalyzerTest.php
View Options
<?php
namespace
Nasqueron\Notifications\Tests\Analyzers\Phabricator
;
use
Nasqueron\Notifications\Analyzers\Phabricator\PhabricatorPayloadAnalyzer
;
use
Nasqueron\Notifications\Tests\TestCase
;
class
PhabricatorPayloadAnalyzerTest
extends
TestCase
{
use
WithConfiguration
;
/**
* @var PhabricatorPayloadAnalyzer
*/
private
$analyzer
;
/**
* @var PhabricatorStory
*/
private
$story
;
public
function
setUp
()
{
parent
::
setUp
();
$this
->
story
=
$this
->
getStory
();
$this
->
analyzer
=
new
PhabricatorPayloadAnalyzer
(
"Nasqueron"
,
$this
->
story
);
}
public
function
testGetConfigurationFileName
()
{
$this
->
assertSame
(
"PhabricatorPayloadAnalyzer/Nasqueron.json"
,
$this
->
analyzer
->
getConfigurationFileName
()
);
}
public
function
testGetGroupWhereEventIsAdministrative
()
{
$this
->
markTestIncomplete
(
"Not yet implemented feature. See T664."
);
$this
->
assertSame
(
"orgz"
,
$this
->
analyzer
->
getGroup
()
);
}
public
function
testGetGroupWhereStoryDoesntMatchAnything
()
{
$this
->
attachProjectsToStoryMock
(
$this
->
story
,
[]);
$this
->
assertSame
(
"nasqueron"
,
$this
->
analyzer
->
getGroup
()
);
}
public
function
testGetGroupWhereStoryMatchesProject
()
{
$this
->
attachProjectsToStoryMock
(
$this
->
story
,
[
'Docker images'
]);
$this
->
assertSame
(
"docker"
,
$this
->
analyzer
->
getGroup
()
);
}
public
function
testGetGroupWhereStoryMatchesWords
()
{
$this
->
attachProjectsToStoryMock
(
$this
->
story
,
[]);
$this
->
story
->
text
=
"Review the cartography elements."
;
$this
->
assertSame
(
"tasacora"
,
$this
->
analyzer
->
getGroup
()
);
}
public
function
testGetGroupWhereWordsAreStrong
()
{
$this
->
markTestIncomplete
(
"Not yet implemented feature. See T748."
);
$this
->
attachProjectsToStoryMock
(
$this
->
story
,
[
'Docker images'
]);
$this
->
story
->
text
=
"Review the cartography elements on Dwellers."
;
$this
->
assertSame
(
"ops"
,
$this
->
analyzer
->
getGroup
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Feb 28, 22:47 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2435388
Default Alt Text
PhabricatorPayloadAnalyzerTest.php (2 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment