Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit feb2c35

Browse files
authored
Merge pull request #9 from Insolita/wip_final
Update migration and model generation
2 parents ac4ae33 + 3d83ce5 commit feb2c35

File tree

143 files changed

+6737
-832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+6737
-832
lines changed

.dockerignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/.idea
2+
/.git
3+
/tests/tmp/*
4+
/vendor
5+
/.dockerignore
6+
/.editorconfig
7+
/.env
8+
/.env.dist
9+
/.gitattributes
10+
/.gitignore
11+
/.php_cs.cache
12+
/composer.lock
13+
/Makefile

.travis.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ php:
44
- '7.1'
55
- '7.2'
66
- '7.3'
7-
- nightly
7+
# - '7.4'
88

9-
install: make install
9+
install:
10+
- travis_retry composer self-update && composer --version
11+
- travis_retry composer install --prefer-dist --no-interaction
1012
script:
1113
- make test
12-
- if [[ $TRAVIS_PHP_VERSION = "7.3" || $TRAVIS_PHP_VERSION = "nightly" ]]; then true; else make check-style; fi
14+
- if [[ $TRAVIS_PHP_VERSION = "7.3" || $TRAVIS_PHP_VERSION = "7.4" ]]; then true; else make check-style; fi

Makefile

+26-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,30 @@ install:
1818
test:
1919
php $(PHPARGS) vendor/bin/phpunit
2020

21-
.PHONY: all check-style fix-style install test
21+
clean_all:
22+
docker-compose down
23+
sudo rm -rf tests/tmp/*
24+
25+
clean:
26+
sudo rm -rf tests/tmp/app/*
27+
sudo rm -rf tests/tmp/docker_app/*
28+
29+
up:
30+
docker-compose up -d
31+
32+
cli:
33+
docker-compose exec php bash
34+
35+
migrate:
36+
mkdir -p "tests/tmp/app"
37+
mkdir -p "tests/tmp/docker_app"
38+
docker-compose run --rm php sh -c 'cd /app/tests && ./yii migrate --interactive=0'
39+
40+
installdocker:
41+
docker-compose run --rm php composer install && chmod +x tests/yii
42+
43+
testdocker:
44+
docker-compose run --rm php sh -c 'vendor/bin/phpunit tests/unit'
45+
46+
.PHONY: all check-style fix-style install test clean clean_all up cli installdocker migrate testdocker
2247

composer.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
},
2020
"require": {
2121
"php": ">=7.1.0",
22-
"cebe/php-openapi": "^1.5",
22+
"cebe/php-openapi": "dev-wip-reference-cache as 1.5",
2323
"yiisoft/yii2": "~2.0.15",
24-
"yiisoft/yii2-gii": "~2.0.0 | ~2.1.0",
24+
"yiisoft/yii2-gii": "~2.0.0 | ~2.1.0| ~2.2.0",
2525
"fzaninotto/faker": "^1.8",
2626
"laminas/laminas-code": "^3.4"
2727
},
@@ -36,6 +36,11 @@
3636
"cebe\\yii2openapi\\": "src/"
3737
}
3838
},
39+
"autoload-dev": {
40+
"psr-4": {
41+
"tests\\": "tests/"
42+
}
43+
},
3944
"config": {
4045
"platform": {
4146
"php": "7.1.3"

docker-compose.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
version: "3.5"
2+
services:
3+
php:
4+
build:
5+
dockerfile: tests/docker/Dockerfile
6+
context: .
7+
volumes:
8+
- ./tests/tmp/.composer:/root/.composer:rw
9+
- .:/app
10+
environment:
11+
- TZ=UTC
12+
- TIMEZONE=UTC
13+
- DB_USER=dbuser
14+
- DB_PASSWORD=dbpass
15+
- IN_DOCKER=docker
16+
depends_on:
17+
- mysql
18+
- postgres
19+
- maria
20+
tty: true
21+
networks:
22+
net: {}
23+
mysql:
24+
image: mysql:5.7
25+
ports:
26+
- '13306:3306'
27+
volumes:
28+
- ./tests/tmp/mysql:/var/lib/mysql:rw
29+
environment:
30+
TZ: UTC
31+
MYSQL_ALLOW_EMPTY_PASSWORD: 1
32+
MYSQL_USER: dbuser
33+
MYSQL_PASSWORD: dbpass
34+
MYSQL_DATABASE: testdb
35+
networks:
36+
net: {}
37+
maria:
38+
image: mariadb
39+
ports:
40+
- '23306:3306'
41+
volumes:
42+
- ./tests/tmp/maria:/var/lib/mysql:rw
43+
environment:
44+
TZ: UTC
45+
MYSQL_ALLOW_EMPTY_PASSWORD: 1
46+
MYSQL_USER: dbuser
47+
MYSQL_PASSWORD: dbpass
48+
MYSQL_DATABASE: testdb
49+
MYSQL_INITDB_SKIP_TZINFO: 1
50+
networks:
51+
net: {}
52+
postgres:
53+
image: postgres:12
54+
ports:
55+
- '15432:5432'
56+
volumes:
57+
- ./tests/tmp/postgres:/var/lib/postgresql/data:rw
58+
environment:
59+
TZ: UTC
60+
PGTZ: UTC
61+
POSTGRES_USER: dbuser
62+
POSTGRES_PASSWORD: dbpass
63+
POSTGRES_DB: testdb
64+
networks:
65+
net: {}
66+
67+
networks:
68+
net: {}

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
stopOnFailure="false">
88
<testsuites>
99
<testsuite name="Test Suite">
10-
<directory suffix="Test.php">./tests</directory>
10+
<directory suffix="Test.php">./tests/unit</directory>
1111
</testsuite>
1212
</testsuites>
1313
<filter>

0 commit comments

Comments
 (0)