Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4793455
JenkinsPayloadAnalyzerConfigurationTest.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
JenkinsPayloadAnalyzerConfigurationTest.php
View Options
<?php
namespace
Nasqueron\Notifications\Tests\Analyzers
;
use
Illuminate\Foundation\Testing\WithoutMiddleware
;
use
Nasqueron\Notifications\Analyzers\Jenkins\JenkinsPayloadAnalyzerConfiguration
;
use
Nasqueron\Notifications\Analyzers\ItemGroupMapping
;
use
Nasqueron\Notifications\Tests\TestCase
;
class
JenkinsPayloadAnalyzerConfigurationTest
extends
TestCase
{
/**
* Configuration
*
* @var \Nasqueron\Notifications\Analyzers\Jenkins\JenkinsPayloadAnalyzerConfiguration
*/
protected
$configuration
;
/**
* Prepares the test
*/
public
function
setUp
()
{
$filename
=
__DIR__
.
'/../../data/JenkinsPayloadAnalyzer/Nasqueron.json'
;
$mapper
=
new
\JsonMapper
();
$this
->
configuration
=
$mapper
->
map
(
json_decode
(
file_get_contents
(
$filename
)),
new
JenkinsPayloadAnalyzerConfiguration
(
'Nasqueron'
)
);
parent
::
setUp
();
}
/**
* Determines the JSON object is well parsed
*/
public
function
testProperties
()
{
$this
->
assertSame
(
"ci"
,
$this
->
configuration
->
defaultGroup
);
foreach
(
$this
->
configuration
->
map
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
Fri, Feb 28, 21:45 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2437552
Default Alt Text
JenkinsPayloadAnalyzerConfigurationTest.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment