From a1300a4ab8ecbdca4f146a11c7205a901e0a8d73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A9r=C3=B4me=20Canals?= <gerome.canals@univ-lorraine.fr>
Date: Fri, 23 Aug 2024 11:03:48 +0200
Subject: [PATCH] image tests

---
 php/test/docker-php-apache.test-with-certs.sh | 15 +++++++++++++++
 php/test/docker-php-apache.test.sh            |  2 +-
 php/test/docker-php-cli.test.sh               |  2 +-
 php/test/html/index.php                       |  2 ++
 php/test/src/sample.php                       |  2 +-
 5 files changed, 20 insertions(+), 3 deletions(-)
 create mode 100755 php/test/docker-php-apache.test-with-certs.sh

diff --git a/php/test/docker-php-apache.test-with-certs.sh b/php/test/docker-php-apache.test-with-certs.sh
new file mode 100755
index 0000000..4e39b08
--- /dev/null
+++ b/php/test/docker-php-apache.test-with-certs.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+tag="latest"
+if [ $# -ge 1 ]; then
+    tag=$1
+fi
+
+echo "running a canals/php based container with tag : $tag"
+
+docker run --rm\
+       -p 9080:80 -p 9443:443 \
+       -v "$PWD"/html:/var/www/html \
+       -v "$PWD"/src:/var/www/src \
+       -v "$PWD"/ssl:/etc/ssl \
+       canals/php:$tag
diff --git a/php/test/docker-php-apache.test.sh b/php/test/docker-php-apache.test.sh
index 721b1be..a33f405 100755
--- a/php/test/docker-php-apache.test.sh
+++ b/php/test/docker-php-apache.test.sh
@@ -1,4 +1,4 @@
-#!/usr/local/bin/bash
+#!/bin/bash
 
 tag="latest"
 if [ $# -ge 1 ]; then
diff --git a/php/test/docker-php-cli.test.sh b/php/test/docker-php-cli.test.sh
index b9607ed..b67d94f 100755
--- a/php/test/docker-php-cli.test.sh
+++ b/php/test/docker-php-cli.test.sh
@@ -1,4 +1,4 @@
-#!/usr/local/bin/bash
+#!/bin/bash
 
 
 if [ $# -lt 1 ]; then
diff --git a/php/test/html/index.php b/php/test/html/index.php
index 6dc7b55..86b4fe6 100644
--- a/php/test/html/index.php
+++ b/php/test/html/index.php
@@ -15,3 +15,5 @@ echo <<<EOT
 <body> <h1> php is working ! </h1> <h2> sample : $sample</h2>
 </html>
 EOT;
+
+xdebug_info();
\ No newline at end of file
diff --git a/php/test/src/sample.php b/php/test/src/sample.php
index e344314..c2f892c 100644
--- a/php/test/src/sample.php
+++ b/php/test/src/sample.php
@@ -7,6 +7,6 @@
  * @author: canals
  */
 
-$sample ='hungry heart';
+$sample ='yoo man';
 
 return $sample;
\ No newline at end of file
-- 
GitLab