소스 검색

Merge pull request #1044 from MBonell/606-test-php-hello-world

Add test for php-cli image
yosifkit 10 년 전
부모
커밋
e96d78677e
4개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      test/config.sh
  2. 1 0
      test/tests/php-hello-world/expected-std-out.txt
  3. 1 0
      test/tests/php-hello-world/index.php
  4. 7 0
      test/tests/php-hello-world/run.sh

+ 1 - 0
test/config.sh

@@ -79,6 +79,7 @@ declare -A imageTests=(
 	'
 	[php]='
 		php-ext-install
+		php-hello-world
 	'
 	[php:fpm]='
 		php-fpm-hello-web

+ 1 - 0
test/tests/php-hello-world/expected-std-out.txt

@@ -0,0 +1 @@
+Hello World!

+ 1 - 0
test/tests/php-hello-world/index.php

@@ -0,0 +1 @@
+<?php echo "Hello World!"; ?>

+ 7 - 0
test/tests/php-hello-world/run.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+image="$1"
+dirTest="$(dirname "$(readlink -f "$BASH_SOURCE")")"
+dirContainer='/var/www/html/hello-world'
+
+docker run -it --rm -v "$dirTest":"$dirContainer" -w "$dirContainer" "$image" php index.php