Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Add PHP 7.3 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petk committed Jun 23, 2018
1 parent 7ded6dc commit 3c2ec11
Show file tree
Hide file tree
Showing 21 changed files with 332 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/7.3-apache/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
file:
/var/log/apache2/access.log:
exists: true
mode: "0777"
size: 11
owner: root
group: wheel
linked-to: /dev/stdout
filetype: symlink
contains: []
/var/log/apache2/error.log:
exists: true
mode: "0777"
size: 11
owner: root
group: wheel
linked-to: /dev/stderr
filetype: symlink
contains: []
package:
apache2:
installed: true
port:
tcp:80:
listening: false
ip: []
process:
httpd:
running: true
http:
http://localhost:
status: 200
allow-insecure: false
no-follow-redirects: false
timeout: 5000
body:
- It works!
8 changes: 8 additions & 0 deletions tests/7.3-apache/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

docker build -t phpearth/test:7.3-apache -f ../../docker/7.3-apache.Dockerfile ../../docker || exit 1

i=0
time dgoss run -p 80:80 phpearth/test:7.3-apache || ((i++))

exit $i
7 changes: 7 additions & 0 deletions tests/7.3-argon/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM phpearth/test:7.3-cli

RUN mkdir -p /usr/src/app

ADD argon.php /usr/src/app/argon.php

WORKDIR /usr/src/app
7 changes: 7 additions & 0 deletions tests/7.3-argon/argon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

// plain text password
$password = 'secretcode';

// password hashed with PASSWORD_ARGON2I
echo password_hash($password, PASSWORD_ARGON2I);
5 changes: 5 additions & 0 deletions tests/7.3-argon/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
command:
php argon.php:
exit-status: 0
stderr: ['!/./']
timeout: 10000
9 changes: 9 additions & 0 deletions tests/7.3-argon/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

docker build --no-cache -t phpearth/test:7.3-cli -f ../../docker/7.3-cli.Dockerfile ../../docker || exit 1
docker build --no-cache -t phpearth/test:7.3-argon -f Dockerfile .

i=0
time dgoss run -it phpearth/test:7.3-argon || ((i++))

exit $i
49 changes: 49 additions & 0 deletions tests/7.3-cgi/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
command:
php-cgi -m:
exit-status: 0
stdout:
- '[PHP Modules]'
- bcmath
- bz2
- calendar
- cgi-fcgi
- Core
- ctype
- curl
- date
- dom
- exif
- fileinfo
- filter
- ftp
- hash
- iconv
- json
- libxml
- mbstring
- openssl
- pcre
- Phar
- posix
- readline
- Reflection
- session
- shmop
- SimpleXML
- sockets
- SPL
- standard
- sysvmsg
- sysvsem
- sysvshm
- tokenizer
- xml
- xmlreader
- xmlwriter
- Zend OPcache
- zip
- zlib
- '[Zend Modules]'
- Zend OPcache
stderr: []
timeout: 10000
8 changes: 8 additions & 0 deletions tests/7.3-cgi/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

docker build -t phpearth/test:7.3-cgi -f ../../docker/7.3-cgi.Dockerfile ../../docker || exit 1

i=0
time dgoss run -it phpearth/test:7.3-cgi || ((i++))

exit $i
5 changes: 5 additions & 0 deletions tests/7.3-composer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM phpearth/test:7.3-cli

RUN set -x \
&& apk add --no-cache \
composer
7 changes: 7 additions & 0 deletions tests/7.3-composer/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
command:
composer about:
exit-status: 0
stdout:
- 'Composer - Package Management for PHP'
stderr: []
timeout: 10000
9 changes: 9 additions & 0 deletions tests/7.3-composer/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

docker build -t phpearth/test:7.3-cli -f ../../docker/7.3-cli.Dockerfile ../../docker || exit 1
docker build -t phpearth/test:7.3-composer -f Dockerfile .

i=0
time dgoss run -it phpearth/test:7.3-composer || ((i++))

exit $i
15 changes: 15 additions & 0 deletions tests/7.3-extensions/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM phpearth/test:7.3-cli

RUN apk add --no-cache \
php7.3-apcu \
php7.3-cmark \
php7.3-ds \
php7.3-imagick \
php7.3-sodium \
php7.3-memcached \
php7.3-meminfo \
php7.3-mongodb \
php7.3-redis \
php7.3-swoole \
php7.3-xdebug \
php7.3-yaml
61 changes: 61 additions & 0 deletions tests/7.3-extensions/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
command:
php -m:
exit-status: 0
stdout:
- '[PHP Modules]'
- apcu
- bcmath
- bz2
- calendar
- cmark
- Core
- ctype
- curl
- date
- dom
- ds
- exif
- fileinfo
- filter
- ftp
- hash
- iconv
- imagick
- json
- sodium
- libxml
- mbstring
- memcached
- meminfo
- mongodb
- openssl
- pcre
- Phar
- posix
- readline
- redis
- Reflection
- session
- shmop
- SimpleXML
- sockets
- SPL
- standard
- swoole
- sysvmsg
- sysvsem
- sysvshm
- tokenizer
- xdebug
- xml
- xmlreader
- xmlwriter
- yaml
- Zend OPcache
- zip
- zlib
- '[Zend Modules]'
- Xdebug
- Zend OPcache
stderr: []
timeout: 10000
9 changes: 9 additions & 0 deletions tests/7.3-extensions/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

docker build -t phpearth/test:7.3-cli -f ../../docker/7.3-cli.Dockerfile ../../docker || exit 1
docker build -t phpearth/test:7.3-extensions -f Dockerfile .

i=0
time dgoss run -it phpearth/test:7.3-extensions || ((i++))

exit $i
20 changes: 20 additions & 0 deletions tests/7.3-litespeed/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
file:
/var/log/litespeed/access.log:
exists: true
linked-to: /dev/stdout
filetype: symlink
/var/log/litespeed/error.log:
exists: true
linked-to: /dev/stderr
filetype: symlink
process:
litespeed:
running: true
http:
http://localhost:8088:
status: 200
allow-insecure: false
no-follow-redirects: false
timeout: 5000
body:
- You have successfully installed the OpenLiteSpeed Web Server!
8 changes: 8 additions & 0 deletions tests/7.3-litespeed/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

docker build -t phpearth/test:7.3-litespeed -f ../../docker/7.3-litespeed.Dockerfile ../../docker || exit 1

i=0
time dgoss run -p 8088:8088 phpearth/test:7.3-litespeed || ((i++))

exit $i
27 changes: 27 additions & 0 deletions tests/7.3-nginx/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
file:
/var/log/nginx/access.log:
exists: true
linked-to: /dev/stdout
filetype: symlink
/var/log/nginx/error.log:
exists: true
linked-to: /dev/stderr
filetype: symlink
package:
nginx:
installed: true
port:
tcp:80:
listening: true
ip:
- 0.0.0.0
process:
nginx:
running: true
http:
http://localhost:
status: 200
no-follow-redirects: false
timeout: 5000
body:
- PHP Version 7.3
8 changes: 8 additions & 0 deletions tests/7.3-nginx/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

docker build -t phpearth/test:7.3-nginx -f ../../docker/7.3-nginx.Dockerfile ../../docker || exit 1

i=0
time dgoss run phpearth/test:7.3-nginx || ((i++))

exit $i
5 changes: 5 additions & 0 deletions tests/7.3-phpunit/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM phpearth/test:7.3-cli

RUN set -x \
&& apk add --no-cache \
phpunit
19 changes: 19 additions & 0 deletions tests/7.3-phpunit/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
command:
phpunit --version:
exit-status: 0
stdout:
- 'by Sebastian Bergmann and contributors.'
stderr: []
timeout: 10000
phpunit --atleast-version 8:
exit-status: 1
stdout:
- ''
stderr: []
timeout: 10000
phpunit --atleast-version 6.3:
exit-status: 0
stdout:
- ''
stderr: []
timeout: 10000
9 changes: 9 additions & 0 deletions tests/7.3-phpunit/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

docker build -t phpearth/test:7.3-cli -f ../../docker/7.3-cli.Dockerfile ../../docker || exit 1
docker build -t phpearth/test:7.3-phpunit -f Dockerfile .

i=0
time dgoss run -it phpearth/test:7.3-phpunit || ((i++))

exit $i

0 comments on commit 3c2ec11

Please sign in to comment.