-
create a database (eg.
demo_db
) -
setup configuration in
config.php
, for example:<?php const APP_DATABASE_HOST = '127.0.0.1'; const APP_DATABASE_PORT = '3306'; const APP_DATABASE_USER = 'root'; const APP_DATABASE_PWD = 'root'; const APP_DATABASE_NAME = 'demo_db';
-
create table
user
with the following syntax:CREATE TABLE `user` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `enabled` tinyint(1) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email_unique` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
create table
log
with the following syntax:CREATE TABLE `log` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL, `event` varchar(255) NOT NULL DEFAULT '', `tags` longtext NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
create a database (eg.
demo_db_test
) -
setup configuration in
config.test.php
, for example:<?php const APP_DATABASE_HOST = '127.0.0.1'; const APP_DATABASE_PORT = '3306'; const APP_DATABASE_USER = 'root'; const APP_DATABASE_PWD = 'root'; const APP_DATABASE_NAME = 'demo_db_test';
-
run
./phpunit --bootstrap init.php Tests