Page MenuHomeDevCentral

D277.id653.diff
No OneTemporary

D277.id653.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
Wed, Nov 27, 19:38 (8 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2267629
Default Alt Text
D277.id653.diff (1 KB)

Event Timeline