Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F25243769
GitHubPayloadAnalyzerTest.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
GitHubPayloadAnalyzerTest.php
View Options
<?php
namespace
Nasqueron\Notifications\Tests\Analyzers
;
use
Nasqueron\Notifications\Analyzers\GitHub\GitHubPayloadAnalyzer
;
use
Nasqueron\Notifications\Tests\TestCase
;
class
GitHubPayloadAnalyzerTest
extends
TestCase
{
/**
* @var Nasqueron\Notifications\Analyzers\GitHub\GitHubPayloadAnalyzer
*/
private
$unknownEventAnalyzer
;
/**
* Prepares the tests
*/
public
function
setUp
()
{
parent
::
setUp
();
$this
->
unknownEventAnalyzer
=
new
GitHubPayloadAnalyzer
(
"Acme"
,
"quux"
,
new
\stdClass
);
}
///
/// Test constructor
///
/**
* @expectedException InvalidArgumentException
*/
public
function
testConstructorThrowsAnExceptionWhenPayloadIsInvalid
()
{
new
GitHubPayloadAnalyzer
(
"Acme"
,
"push"
,
"This is not an object deserialized from JSON but a string."
);
}
///
/// Test if our fallback is correct when the GitHub event type is unknown
///
public
function
testDescriptionContainsTypeWhenEventTypeIsUnknown
()
{
$this
->
assertContains
(
"quux"
,
$this
->
unknownEventAnalyzer
->
getDescription
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Apr 9, 02:07 (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3592048
Default Alt Text
GitHubPayloadAnalyzerTest.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment