-
Notifications
You must be signed in to change notification settings - Fork 12
Development
Create a database for the tool:
CREATE DATABASE fewohbee CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Copy the file .env.dist and name the new file .env.
Make sure to set all configuration parameters defined in .env according to Configuration.
If not already present, download the PHP dependency manager composer to be able to install the property management tool dependencies. Then run the following command in the project's root folder:
For APP_ENV=dev:
composer install
For APP_ENV=prod:
composer install --no-dev --optimize-autoloader
Run the following command to initialize the database and the application:
php bin/console doctrine:migration:migrate
php bin/console asset-map:compile
php bin/console app:first-run
Then you can navigate to the installation folder with a web browser, e.g. http://localhost/fewohbee/public/index.php to log in with the previously created login data.
With version 2.1.1, test data can be imported automatically. This makes the first use easier.
The following command must be executed to install test data for: settings, reservations, invoices, and templates:
php bin/console doctrine:fixtures:load --append
If you only want the templates, for example:
php bin/console doctrine:fixtures:load --append --group templates
Use the helper script to reset the test database, seed initial data (including app:first-run), load fixtures and run PHPUnit in one go:
bin/run-tests.sh
The script defaults to APP_ENV=test. Override credentials or metadata by exporting variables such as FIRST_RUN_USERNAME, FIRST_RUN_PASSWORD, FIRST_RUN_EMAIL, etc. Any extra arguments are forwarded to PHPUnit: bin/run-tests.sh --filter Kernel.
Make sure the file .env.testexists which contains the following entries (update parameters accordingly, the database is dropped and recreated after each run so make sure to not define your prod db here):
APP_ENV=test
APP_SECRET=<secret>
# keep tests isolated from dev data by pointing Doctrine to a dedicated MariaDB schema
DATABASE_URL=mysql://<user>:<pw>@db:3306/fewohbee_test_suite
DB_SERVER_VERSION=12.1.2-MariaDB
# mailers are disabled when tests run
MAILER_DSN=null://null
FROM_MAIL=test@example.com
FROM_NAME="FewohBee Tests"
RETURN_PATH=test@example.com
MAIL_COPY=false
WEB_HOST=http://localhost
CUSTOMER_SALUTATIONS=Herr,Frau