03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Controller Testing 370<br />

the Str class. Every facade allows you to mock methods (facades subclass the MockObject class), and<br />

you can even swap them out with your own mocks (using the Validator::swap($validatorMock)<br />

method).<br />

.<br />

You can test static method calls using the AspectMock library, which you can learn more about at:<br />

https://github.com/Codeception/AspectMock.<br />

https://github.com/Codeception/AspectMock<br />

.<br />

You can learn more about facades at: http://laravel.com/docs/facades.<br />

http://laravel.com/docs/facades<br />

Finally, let’s test the controller:<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!