This repository was archived by the owner on Mar 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 330
Setting up testing database
Ariel Vallese edited this page Jun 15, 2016
·
12 revisions
This page will guide you to setup your testing database to be able to run PHPUnit, for development.
Make sure you have already installed timegrid and updated composer packages with --dev
parameter.
From your command-line, access to the mysql prompt.
mysql -u root -p
Once into the MySQL console
-- Create a database called `testing_timegrid`:
CREATE DATABASE testing_timegrid;
-- Create a user with the same name:
CREATE USER 'testing_timegrid'@'localhost' IDENTIFIED BY 'testing_timegrid';
-- Grant all permissions:
GRANT ALL PRIVILEGES ON `testing_timegrid`.* TO 'testing_timegrid'@'localhost';
Logout from mysql prompt
Ctrl + D
From your command-line, run the migrations:
php artisan migrate --database=testing
You should be ready to run unit tests with phpunit:
vendor/bin/phpunit
You will find the current test coverage status on CodeClimate
You may run:
php -d xdebug.profiler_enable=on vendor/bin/phpunit --coverage-html build/coverage --testdox-html build/testdox.html
Or enable xdebug and the logging
directive on phpunit.xml
The reports will be generated on the build/
directory.
alariva