From 129360507d6bb7c3ad6ac4bfadc9243083faf42b Mon Sep 17 00:00:00 2001 From: Alex Rock Ancelet Date: Thu, 23 Feb 2023 18:13:35 +0100 Subject: [PATCH] Small minor details for local dev --- CONTRIBUTING.md | 6 ++++-- tests/bootstrap.php | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 378114a..4247ca9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,8 @@ ## MySQL -To execute the test suite, you need running a MySQL server. +To execute the test suite, you need a running MySQL server. + The easiest way to get them up and running is using Docker: docker run --rm --platform=linux/amd64 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=odm -p 3306:3306 -d mysql @@ -13,7 +14,8 @@ Then run the test suite: ## Postgres -To execute the test suite, you need running a PostgreSQL server. +To execute the test suite, you need a running PostgreSQL server. + The easiest way to get them up and running is using Docker: docker run --rm -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 21209ec..4b271ac 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -7,9 +7,19 @@ * with this source code in the file LICENSE. */ +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Console\Style\SymfonyStyle; + date_default_timezone_set('UTC'); $loader = require __DIR__.'/../vendor/autoload.php'; require __DIR__.'/Fixtures/AppKernel.php'; +if (!isset($_SERVER['DATABASE_URL'])) { + (new SymfonyStyle(new ArrayInput([]), new ConsoleOutput()))->error("DATABASE_URL environment var is not set.\nCheck the CONTRIBUTING.md file for more details about how to test this project."); + + exit(1); +} + return $loader;