# # This Makefile functions both as an easy way to issue # some common but easy to forget commands for this # project, while also serving as something of a cheat- # sheet for those same commands. Use this Makefile # if you want, or just use it as a reference. # # To use one of the commands in this Makefile, simply # type something like # # make autoload # # or # # make routeclear # # make is a standard software development tool, though # a bit "old-school." But you should be able to find # man files or other documentation for it easily. COMPOSER=/usr/local/bin/composer #========================================================== # When you add a new class to one of the non-standard # namespaces, you have to do a "dump-autoload" .PHONY: start autoload: $(COMPOSER) dump-autoload #========================================================== # When you make changes to the routing configuration, # you may need to clear the routes. .PHONY: routeclear routeclear: php artisan route:clear #========================================================= # When run from the root of the project, this fires up a # test server. You can view the results of the test server # with "curl localhost:8000/hello" or whatever .PHONY: serve serve: php artisan serve #========================================================== # Run phpunit (the version delivered with this project, not # a separately installed version of phpunit.) test: php ./vendor/bin/phpunit #========================================================== # Sometimes I type "tests" instead of test. So run the test # target if I stupidly type tests. tests: test #========================================================== # This target creates a unit test for this project. Usage: # # make testname= createtest # # Note that the class name must end in Test for it to work. # Also, --unit tells the test creation to create the test # in the tests/Unit directory. (New tests are created in # either Unit or Feature, and it's a hassle to override that # obnoxious behavior.) createtest: php artisan make:test --unit $(testname)