Environment to run test locally
This commit is contained in:
parent
5158cf22b3
commit
68df0e1f49
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
ARG PHP_IMAGE_TAG
|
||||||
|
FROM php:${PHP_IMAGE_TAG}-cli-alpine
|
||||||
|
|
||||||
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
WORKDIR /opt/test
|
16
Makefile
Normal file
16
Makefile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
ifneq (,$(shell (type docker-compose 2>&1 >/dev/null && echo 1) || true))
|
||||||
|
PHP=docker-compose run --rm --no-deps php
|
||||||
|
else
|
||||||
|
PHP=php
|
||||||
|
endif
|
||||||
|
|
||||||
|
PHP_CONSOLE_DEPS=vendor
|
||||||
|
|
||||||
|
vendor: composer.json
|
||||||
|
@$(PHP) composer install -o -n --no-ansi
|
||||||
|
@touch vendor || true
|
||||||
|
|
||||||
|
phpunit: $(PHP_CONSOLE_DEPS)
|
||||||
|
@$(PHP) vendor/bin/phpunit --color=always
|
||||||
|
|
||||||
|
check: phpunit
|
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
version: '3.4'
|
||||||
|
|
||||||
|
services:
|
||||||
|
php:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
PHP_IMAGE_TAG: ${PHP_IMAGE_TAG:-7.4}
|
||||||
|
volumes:
|
||||||
|
- "./:/opt/test"
|
||||||
|
|
@ -1,13 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Composer\Autoload\ClassLoader;
|
return require __DIR__.'/../vendor/autoload.php';
|
||||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var ClassLoader $loader
|
|
||||||
*/
|
|
||||||
$loader = require __DIR__.'/../vendor/autoload.php';
|
|
||||||
|
|
||||||
AnnotationRegistry::registerLoader('class_exists');
|
|
||||||
|
|
||||||
return $loader;
|
|
||||||
|
Loading…
Reference in New Issue
Block a user