Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12943935
PullRequestEventTest.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
PullRequestEventTest.php
View Options
<?php
namespace
Nasqueron\Notifications\Tests\Analyzers\GitHub\Events
;
use
Nasqueron\Notifications\Analyzers\GitHub\Events\PullRequestEvent
;
use
Nasqueron\Notifications\Tests\TestCase
;
class
PullRequestEventTest
extends
TestCase
{
/**
* @var \stdClass
*/
private
$payload
;
public
function
setUp
()
{
$filename
=
__DIR__
.
"/../../../data/payloads/GitHubEvents/pull_request.json"
;
$this
->
payload
=
json_decode
(
file_get_contents
(
$filename
));
parent
::
setUp
();
}
/**
* @dataProvider payloadDescriptionProvider
*/
public
function
testWhenRepositoryPerAction
(
$action
,
$description
)
{
$this
->
payload
->
action
=
$action
;
$event
=
new
PullRequestEvent
(
$this
->
payload
);
$this
->
assertSame
(
$description
,
$event
->
getDescription
());
}
/**
* Provides actions and descritions for testWhenRepositoryPerAction
*
* See https://developer.github.com/v3/activity/events/types/#pullrequestevent
*/
public
function
payloadDescriptionProvider
()
{
return
[
[
'assigned'
,
"baxterthehacker has assigned the pull request #1 — Update the README with new information to alken-orin"
],
[
'unassigned'
,
"baxterthehacker has edited the assignees from the pull request #1 — Update the README with new information"
],
[
'labeled'
,
"baxterthehacker has labeled the pull request #1 — Update the README with new information"
],
[
'unlabeled'
,
"baxterthehacker has removed a label from the pull request #1 — Update the README with new information"
],
[
'opened'
,
"baxterthehacker has opened a pull request: #1 — Update the README with new information"
],
[
'edited'
,
"baxterthehacker has edited the pull request #1 — Update the README with new information"
],
[
'closed'
,
"baxterthehacker has closed the pull request #1 — Update the README with new information"
],
[
'reopened'
,
"baxterthehacker has reopened the pull request #1 — Update the README with new information"
],
[
'quuxed'
,
"Unknown pull request action: quuxed"
],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Nov 18, 17:00 (11 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3145106
Default Alt Text
PullRequestEventTest.php (2 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment