Page MenuHomeDevCentral

Test a GitHub ping payload, events disabled
ClosedPublic

Authored by dereckson on Jan 9 2016, 04:00.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 02:12
Unknown Object (File)
Thu, Dec 12, 11:44
Unknown Object (File)
Thu, Dec 12, 03:46
Unknown Object (File)
Wed, Dec 11, 01:11
Unknown Object (File)
Tue, Dec 10, 10:03
Unknown Object (File)
Tue, Dec 10, 09:54
Unknown Object (File)
Sat, Dec 7, 01:49
Unknown Object (File)
Wed, Dec 4, 20:09
Subscribers
None

Details

Reviewers
dereckson
Commits
Unknown Object (Diffusion Commit)
rNOTIF7b342bbc1f18: Test a GitHub ping payload, events disabled
Summary

Test purpose

This test fires the first GitHub event we received, a ping
with a zen aphorism. A blank report should be received,
with correct gate an door.

Services service provider change

To play nice with the Laravel testing recommandation to use
a Illuminate\Contracts\Events\Dispatcher mock for the events
dispatcher, we update the ServicesServiceProvider expectation
to use the interface contract, not the actual implementation.

New methods to TestCase

  • disableEvents to mock the events dispatcher
  • sendJsonPayload allows to send an object as JSON payload
  • sendPayload allows to send a raw payload

Laravel offers a way to disable events from testing, but this
only expects the fire method, not a listen method.

Test Plan

phpunit --no-coverage

Diff Detail

Repository
rNOTIF Notifications center
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson retitled this revision from to Test a GitHub ping payload, events disabled.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson updated this object.
dereckson updated this object.
dereckson added inline comments.
tests/Http/Controllers/GitHubGateControllerTest.php
11

Disables

tests/TestCase.php
37

Visits

55

Visits

dereckson edited edge metadata.

TestCase::disableEvents

dereckson updated this object.
dereckson edited edge metadata.
dereckson updated this object.
dereckson edited edge metadata.
This revision is now accepted and ready to land.Jan 9 2016, 04:19
This revision was automatically updated to reflect the committed changes.