Skip to content

Commit

Permalink
test: add tests for php
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed May 30, 2024
1 parent ff23ee7 commit 494b37e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/test-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ jobs:
matrix:
baseImage:
- debian:latest
- ubuntu:latest
- ubuntu:jammy # noble is not supported by ondrej/php yet
- mcr.microsoft.com/devcontainers/base:ubuntu
- mcr.microsoft.com/devcontainers/base:debian
- mcr.microsoft.com/devcontainers/base:alpine
feature:
- base
- dev-tools
- php
- su-exec
- vip-cli
- wp-cli
Expand Down
22 changes: 22 additions & 0 deletions features/test/php/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# shellcheck source=/dev/null
source dev-container-features-test-lib

check "php exists" which php
check "php-fpm exists" which php-fpm
check "pecl exists" which pecl
check "pear exists" which pear
check "composer exists" which composer
check "www-data user exists" getent passwd www-data
check "www-data group exists" getent group www-data

php -m

# gnupg is not available on Alpine
MODULES="apcu bcmath calendar ctype curl date dom exif fileinfo filter ftp gd gmagick gmp hash iconv igbinary intl json libxml mbstring mcrypt memcache memcached mysqli mysqlnd openssl pcntl pcre pdo_mysql pdo_sqlite phar posix random reflection session shmop simplexml soap sockets sodium sqlite3 ssh2 sysvsem sysvshm timezonedb tokenizer xml xmlreader xmlwriter zip zlib"
for module in $MODULES; do
check "PHP module ${module} exists" sh -c "php -m | grep -qi ^${module}$"
done

reportResults

0 comments on commit 494b37e

Please sign in to comment.