Skip to content

Commit c451535

Browse files
committed
Merge branch '1.x' into 2.x
* 1.x: added Drupal in the CI process
2 parents 804cf65 + 364f4cb commit c451535

File tree

2 files changed

+62
-9
lines changed

2 files changed

+62
-9
lines changed

.travis.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@ cache:
77
- vendor
88
- $HOME/.composer/cache/files
99

10-
matrix:
11-
include:
12-
- php: 7.0
13-
- php: 7.1
14-
- php: 7.2
15-
- php: 7.3
16-
fast_finish: true
17-
1810
before_install:
19-
# turn off XDebug
2011
- phpenv config-rm xdebug.ini || return 0
2112

2213
install:
2314
- travis_retry composer install
2415

2516
script: ./vendor/bin/simple-phpunit
17+
18+
jobs:
19+
fast_finish: true
20+
include:
21+
- php: 7.0
22+
- php: 7.1
23+
- php: 7.2
24+
- php: 7.3
25+
- stage: integration tests
26+
php: 7.3
27+
script: ./drupal_test.sh

drupal_test.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
set -x
4+
set -e
5+
6+
REPO=`pwd`
7+
cd /tmp
8+
rm -rf drupal-twig-test
9+
composer create-project --no-interaction drupal-composer/drupal-project:8.x-dev drupal-twig-test
10+
cd drupal-twig-test
11+
(cd vendor/twig && rm -rf twig && ln -sf $REPO twig)
12+
echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php
13+
php ./web/core/scripts/drupal install --no-interaction demo_umami 2>/dev/null > output
14+
perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output
15+
source output
16+
17+
wget https://get.symfony.com/cli/installer -O - | bash
18+
export PATH="$HOME/.symfony/bin:$PATH"
19+
symfony server:start -d --no-tls
20+
ENDPOINT=`symfony server:status -no-ansi | sed -E 's/^.+ http/http/'`
21+
22+
curl -OLsS https://get.blackfire.io/blackfire-player.phar
23+
chmod +x blackfire-player.phar
24+
cat > drupal-tests.bkf <<EOF
25+
name "Drupal tests"
26+
27+
scenario
28+
name "homepage"
29+
set name "admin"
30+
set pass "pass"
31+
32+
visit url('/')
33+
expect status_code() == 200
34+
click link('Articles')
35+
expect status_code() == 200
36+
click link('Dairy-free and delicious milk chocolate')
37+
expect body() matches "/Dairy\-free milk chocolate is made in largely the same way as regular chocolate/"
38+
expect status_code() == 200
39+
click link('Log in')
40+
expect status_code() == 200
41+
submit button("Log in")
42+
param name name
43+
param pass pass
44+
expect status_code() == 303
45+
follow
46+
expect status_code() == 200
47+
click link('Structure')
48+
expect status_code() == 200
49+
EOF
50+
./blackfire-player.phar run drupal-tests.bkf --endpoint=$ENDPOINT --variable name=$DRUPAL_Username --variable pass=$DRUPAL_Password
51+
symfony server:stop

0 commit comments

Comments
 (0)