Page MenuHomeDevCentral

GitHubPayloadAnalyzerConfigurationTest.php
No OneTemporary

GitHubPayloadAnalyzerConfigurationTest.php

<?php
namespace Nasqueron\Notifications\Tests\Analyzers;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Nasqueron\Notifications\Analyzers\GitHub\GitHubPayloadAnalyzerConfiguration;
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(
'Nasqueron\Notifications\Analyzers\GitHub\RepositoryGroupMapping',
$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

Mime Type
text/x-php
Expires
Sun, Jul 27, 20:38 (7 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2821215
Default Alt Text
GitHubPayloadAnalyzerConfigurationTest.php (1 KB)

Event Timeline