Skip to content

Commit

Permalink
Move composer.json into test dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben XO authored and Ben XO committed Dec 31, 2021
1 parent 5dcd693 commit e142639
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
run: ./test/run.sh --do-not-cache-result .
- name: Test with phpunit (Windows)
if: ${{ contains(matrix.operating-system, 'windows') }}
run: cd test ; ..\vendor\bin\phpunit --bootstrap "bootstrap.php" .
run: cd test ; vendor\bin\phpunit --bootstrap "bootstrap.php" .

2 changes: 1 addition & 1 deletion test/combine_coverage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

require_once('../vendor/autoload.php');
require_once('vendor/autoload.php');

use SebastianBergmann\CodeCoverage\Report\Text as PHP_CodeCoverage_Report_Text;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/dir2castWithCoverage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

require_once('../../vendor/autoload.php');
require_once('../vendor/autoload.php');

use SebastianBergmann\CodeCoverage\Filter;
use SebastianBergmann\CodeCoverage\Driver\Selector;
Expand Down
6 changes: 5 additions & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

cd "$SCRIPT_DIR"

if [[ ! -e vendor ]]; then
composer install || (echo "Error: Make sure you have php, composer and xdebug installed."; exit 1)
fi

tests=($@)
if [[ "${tests[@]}" == "" ]]; then
tests=('.')
fi

export XDEBUG_MODE=coverage
rm -f /tmp/cov-*
../vendor/bin/phpunit --bootstrap "$SCRIPT_DIR/bootstrap.php" --coverage-php /tmp/cov-main --coverage-filter ../dir2cast.php ${tests[@]}
vendor/bin/phpunit --bootstrap "$SCRIPT_DIR/bootstrap.php" --coverage-php /tmp/cov-main --coverage-filter ../dir2cast.php ${tests[@]}
php combine_coverage.php
rm -rf testdir /tmp/cov-*

0 comments on commit e142639

Please sign in to comment.