HomeDevCentral

Test a GitHub ping payload, events disabled

Description

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

Reviewers: dereckson

Differential Revision: http://devcentral.nasqueron.org/D195

Details

Provenance
derecksonAuthored on
Differential Revision
D195: Test a GitHub ping payload, events disabled
Parents
rNOTIF32c57bfe2697: Use PHPUnit in `arc unit`
Branches
Unknown
Tags
Unknown