Skip to content

Commit

Permalink
Add interactive web tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hxtree committed Sep 15, 2021
1 parent 9d7645b commit 10d287c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 47 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ luckbydic
# Run Feature CLI Test using local volume
docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ luckbydice:latest php tests/src/Feature/Cli.php 1d10+4*2 0
# Run Chart Test using local volume then http://localhost/chart.html
docker run -it -p 80:80 --mount type=bind,source="$(pwd)"/,target=/application luckbydice:latest php -S 0.0.0.0:80
# Run Interactive Tests server
docker run -it -p 80:80 --mount type=bind,source="$(pwd)"/,target=/application luckbydice:latest bash -c 'cd tests/src/Interactive && php -S 0.0.0.0:80'
# Then vist http://localhost/chart.html
# Run Unit Tests using local volume
docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ luckbydice:latest composer test
Expand Down
43 changes: 0 additions & 43 deletions tests/src/Feature/Chart/chart.html

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Ouxsoft\LuckByDiceTests\Feature\Statistics;

require __DIR__ . '/../../../../vendor/autoload.php';
require __DIR__ . '/../../../vendor/autoload.php';

use Ouxsoft\LuckByDice\Factory\TurnFactory;

Expand Down Expand Up @@ -113,5 +113,5 @@

$html = str_replace("{{datasets}}", $json, $html);

echo file_put_contents(__DIR__ . '/chart.html', $html);
echo $html;

3 changes: 3 additions & 0 deletions tests/src/Interactive/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h1>Interactive Tests</h1>

<a href="/Chart.php">Chart</a>

0 comments on commit 10d287c

Please sign in to comment.