Page MenuHomeDevCentral

D277.id652.diff
No OneTemporary

D277.id652.diff

diff --git a/tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php b/tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php
--- a/tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php
+++ b/tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php
@@ -17,6 +17,11 @@
*/
private $pingAnalyzer;
+ /**
+ * @var Nasqueron\Notifications\Analyzers\GitHub\GitHubPayloadAnalyzer
+ */
+ private $pushAnalyzer;
+
/**
* Prepares the tests
*/
@@ -34,6 +39,14 @@
"ping",
new \stdClass
);
+
+ $filename = __DIR__ . "/../../data/payloads/GitHubEvents/push.json";
+ $payload = json_decode(file_get_contents($filename));
+ $this->pushAnalyzer = new GitHubPayloadAnalyzer(
+ "Nasqueron", // Expected with known config
+ "push",
+ $payload
+ );
}
///
@@ -70,6 +83,18 @@
}
///
+ /// Test getRepository
+ ///
+
+ public function testGetRepositoryWhenEventIsAdministrative () {
+ $this->assertEmpty($this->pingAnalyzer->getRepository());
+ }
+
+ public function testGetRepositoryWhenEventIsRepositoryRelative () {
+ $this->assertSame("public-repo", $this->pushAnalyzer->getRepository());
+ }
+
+ ///
/// Test if our fallback is correct when the GitHub event type is unknown
///

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 19:37 (21 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259855
Default Alt Text
D277.id652.diff (1 KB)

Event Timeline