Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F10813651
GitHubPayloadAnalyzerConfigurationTest.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
GitHubPayloadAnalyzerConfigurationTest.php
View Options
<?php
namespace
Nasqueron\Notifications\Tests\Analyzers
;
use
Illuminate\Foundation\Testing\WithoutMiddleware
;
use
Nasqueron\Notifications\Analyzers\GitHub\GitHubPayloadAnalyzerConfiguration
;
use
Nasqueron\Notifications\Analyzers\ItemGroupMapping
;
use
Nasqueron\Notifications\Tests\TestCase
;
class
GitHubPayloadAnalyzerConfigurationTest
extends
TestCase
{
/**
* Configuration
*
* @var Nasqueron\Notifications\Analyzers\GitHub\GitHubPayloadAnalyzerConfiguration
*/
protected
$configuration
;
/**
* Prepares the test
*/
public
function
setUp
()
{
$filename
=
__DIR__
.
'/../../data/GitHubPayloadAnalyzer/Nasqueron.json'
;
$mapper
=
new
\JsonMapper
();
$this
->
configuration
=
$mapper
->
map
(
json_decode
(
file_get_contents
(
$filename
)),
new
GitHubPayloadAnalyzerConfiguration
(
'Nasqueron'
)
);
parent
::
setUp
();
}
/**
* Determines the JSON object is well parsed
*/
public
function
testProperties
()
{
$this
->
assertSame
(
"orgz"
,
$this
->
configuration
->
administrativeGroup
);
$this
->
assertSame
(
"nasqueron"
,
$this
->
configuration
->
defaultGroup
);
foreach
(
$this
->
configuration
->
repositoryMapping
as
$item
)
{
$this
->
assertInstanceOf
(
ItemGroupMapping
::
class
,
$item
);
}
}
///
/// Tests for getDefaultGroup
///
public
function
testGetDefaultGroup
()
{
$this
->
configuration
->
defaultGroup
=
"quux"
;
$this
->
assertSame
(
"quux"
,
$this
->
configuration
->
getDefaultGroup
());
}
public
function
testGetDefaultGroupWhenNotInConfig
()
{
$this
->
configuration
->
defaultGroup
=
""
;
$this
->
assertSame
(
"nasqueron"
,
$this
->
configuration
->
getDefaultGroup
());
$this
->
configuration
->
defaultGroup
=
null
;
$this
->
assertSame
(
"nasqueron"
,
$this
->
configuration
->
getDefaultGroup
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jul 29, 13:57 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2843076
Default Alt Text
GitHubPayloadAnalyzerConfigurationTest.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment