Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3787773
D277.id653.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D277.id653.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D277: Test GitHubPayloadAnalyzer::getRepository()
Attached
Detach File
Event Timeline
Log In to Comment