Skip to content

Commit 443fd6c

Browse files
committed
test
1 parent 38e308e commit 443fd6c

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

.travis.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
language: php
2+
3+
sudo: false
4+
dist: trusty
5+
6+
# TODO: Add 7.3 after Phalcon 4.0.0 release
7+
php:
8+
- 7.2
9+
10+
git:
11+
depth: 1
12+
13+
cache:
14+
apt: true
15+
ccache: true
16+
timeout: 691200
17+
directories:
18+
- vendor
19+
- $HOME/.composer/cache
20+
- $HOME/cphalcon
21+
- $HOME/ext
22+
23+
before_install:
24+
- export PHP_VERSION=$(php-config --version)
25+
- export PHP_EXTENSION_DIR=$(php-config --extension-dir)
26+
- phpenv config-rm xdebug.ini || true
27+
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com $GH_TOKEN; fi;
28+
- if [ ! -f "$HOME/cphalcon/tests/_ci/phalcon.ini" ]; then git clone -q --depth=1 https://github.com/phalcon/cphalcon.git $HOME/cphalcon >/dev/null 2>&1; fi;
29+
30+
install:
31+
- if [ ! -f $HOME/ext/$PHP_VERSION/phalcon.so ]; then cd $HOME/cphalcon/build && bash ./install --phpize $(phpenv which phpize) --php-config $(phpenv which php-config) && mkdir -p $HOME/ext/$PHP_VERSION && cp $PHP_EXTENSION_DIR/phalcon.so $HOME/ext/$PHP_VERSION/phalcon.so; fi;
32+
- if [ -f $HOME/ext/$PHP_VERSION/phalcon.so ]; then cp $HOME/ext/$PHP_VERSION/phalcon.so $PHP_EXTENSION_DIR/phalcon.so; fi;
33+
- phpenv config-add $HOME/cphalcon/tests/_ci/phalcon.ini
34+
- phpenv config-add $TRAVIS_BUILD_DIR/tests/_ci/memcached.ini
35+
- cd $TRAVIS_BUILD_DIR
36+
- travis_retry composer install --prefer-dist --no-interaction
37+
38+
before_script:
39+
- echo 'CREATE DATABASE zemit CHARSET=utf8 COLLATE=utf8_unicode_ci' | mysql -u root
40+
- echo "CREATE USER 'zemit'@'%' IDENTIFIED BY 'zemit'" | mysql -u root
41+
- echo "GRANT ALL PRIVILEGES ON zemit.* TO 'zemit'@'%' WITH GRANT OPTION" | mysql -u root
42+
- cat schemas/forum.sql | mysql -u root zemit
43+
- cp ./tests/.env.travis .env
44+
- php -S 127.0.0.1:8000 -t public/ .htrouter.php >/dev/null 2>&1 &
45+
46+
script:
47+
- vendor/bin/phpcs
48+
- vendor/bin/codecept build
49+
- vendor/bin/codecept run unit
50+
- vendor/bin/codecept run functional
51+
- vendor/bin/codecept run acceptance
52+
- vendor/bin/codecept run console
53+
54+
notifications:
55+
email:
56+
recipients:
57+
58+
on_success: change
59+
on_failure: always
60+
61+
addons:
62+
apt:
63+
packages:
64+
- beanstalkd
65+
- mysql-server-5.7
66+
- mysql-client-core-5.7
67+
- mysql-client-5.7
68+
hosts:
69+
- db
70+
- zemit.loc

codeception.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# can be changed while bootstrapping project
2+
actor: Tester
3+
paths:
4+
# where the modules stored
5+
tests: tests
6+
log: tests/_output
7+
# directory for fixture data
8+
data: tests/_data
9+
# directory for custom modules (helpers)
10+
support: tests/_support
11+
envs: tests/_envs
12+
settings:
13+
# name of bootstrap that will be used
14+
# each bootstrap file should be
15+
# inside a suite directory.
16+
bootstrap: _bootstrap.php
17+
colors: true
18+
# Tests (especially functional) can take a lot of memory
19+
# We set a high limit for them by default.
20+
memory_limit: 1024M
21+
log: true
22+
coverage:
23+
enabled: true
24+
whitelist:
25+
include:
26+
- app/*
27+
28+
extensions:
29+
enabled:
30+
- Codeception\Extension\RunFailed # default extension
31+
32+
# Get params from .env file
33+
params:
34+
- .env
35+
36+
# Global modules configuration.
37+
modules:
38+
config:
39+
Db:
40+
dsn: "%DB_DSN%"
41+
user: "%DB_USERNAME%"
42+
password: "%DB_PASSWORD%"
43+
dump: tests/_data/dump.sql
44+
populate: false
45+
cleanup: false
46+
Phalcon:
47+
bootstrap: "tests/_config/bootstrap.php"
48+
cleanup: false
49+
savepoints: false
50+
51+
error_level: "E_ALL"

tests/_data/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)