Page MenuHomeDevCentral

Tests for console commands
ClosedPublic

Authored by dereckson on Jan 12 2016, 18:26.
Tags
None
Referenced Files
F56302847: D240.diff
Wed, Nov 4, 20:02
F55953558: D240.id565.diff
Sun, Nov 1, 18:08
F55953438: D240.id564.diff
Sun, Nov 1, 18:07
F55953403: D240.id566.diff
Sun, Nov 1, 18:07
F55913154: D240.id567.diff
Sun, Nov 1, 11:43
F55907905: D240.diff
Sun, Nov 1, 10:54
Unknown Object (File)
Tue, Oct 20, 22:55
Unknown Object (File)
Tue, Oct 20, 22:07
Subscribers
None

Details

Reviewers
dereckson
Commits
Unknown Object (Diffusion Commit)
rNOTIFf6c50f85d0c7: Tests for console commands
Summary

The kernel test checks if every command in app/Console/Commands/ is
also declared app/Console/Kernel.php $commands array (or otherwise
added to the console kernel).

The TestCase class provides logic specific to test commands: it
resolves the command and gets a Symfony command tester instance.

We give a sample of how to implement a test class for a command in
InspireTest, which tests the Laravel default command inspire.

Reference: http://symfony.com/doc/current/components/console/introduction.html#testing-commands

Test Plan

Run tests

Diff Detail

Repository
rNOTIF Notifications center
Lint
Lint Passed
Unit
Test Failures
Branch
test/console

Event Timeline

dereckson retitled this revision from to Tests for console commands.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson updated this object.
dereckson removed a subscriber: alken-orin.
dereckson added inline comments.
tests/Console/Commands/TestCase.php
60

Add \n

dereckson marked an inline comment as done.
dereckson edited edge metadata.

\n

dereckson added inline comments.
tests/Console/Commands/TestCase.php
10

not used

tests/Console/KernelTest.php
9

Not used

dereckson added inline comments.
tests/Console/Commands/TestCase.php
10

Used: return self::findInstanceOf($expectedType, Artisan::all()); (line 57)

dereckson marked an inline comment as done.
dereckson edited edge metadata.

-use Config;

dereckson edited edge metadata.
This revision is now accepted and ready to land.Jan 12 2016, 18:42
dereckson edited edge metadata.

Correct branch

This revision was automatically updated to reflect the committed changes.