-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from lucatume/wrap-kagg-design-php8
Wrap PR #17
- Loading branch information
Showing
38 changed files
with
299 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
run: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] | ||
name: PHP ${{ matrix.php-version }} on ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: PHPUnit tests | ||
run: "vendor/bin/phpunit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ composer.lock | |
patchwork.json | ||
cache/* | ||
pw-cs-*.yml | ||
.phpunit.result.cache |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
# This file updates tests according to the phpunit library used for current php version, or php version in 1st argument. | ||
# Usage: | ||
# update-tests - to update tests according to the phpunit library used for current php version. | ||
# update-tests x.x - to update tests according to the phpunit library used for specific php version x.x, where x.x = 5.6|7.0|7.1|7.2|7.3|7.4|8.0. | ||
|
||
# Directory with phpunit tests. | ||
TEST_DIR="tests" | ||
|
||
if grep -q Microsoft /proc/version; then | ||
DEV_MODE=$(cmd.exe /c echo %COMPOSER_DEV_MODE% | sed -nr 's/\r//p') | ||
else | ||
DEV_MODE=$COMPOSER_DEV_MODE | ||
fi | ||
|
||
if [[ $1 == '' && $DEV_MODE != '1' ]]; then | ||
echo "Script works with composer in dev mode only." | ||
exit 0 | ||
fi | ||
|
||
if [[ $1 == '' ]]; then | ||
PHP_VERSION=$(php -v | sed -nr "s/PHP ([^.]*?\.[^.]*?)\..*/\1/p") | ||
else | ||
if [[ $1 == 'revert' ]]; then | ||
# Restore test files to the current branch version. | ||
git checkout -- $TEST_DIR | ||
echo "Tests reverted to the initial state." | ||
exit 0 | ||
fi | ||
PHP_VERSION=$1 | ||
fi | ||
|
||
echo "PHP_VERSION: $PHP_VERSION" | ||
|
||
VERSION_FILE="vendor/phpunit/phpunit/src/Runner/Version.php" | ||
CURRENT_PHP_UNIT='' | ||
|
||
RESULT=$(test -f $VERSION_FILE && sed -nr "s/.*new Version.+'(.+\..+)\..*'.*/\1/p" $VERSION_FILE) | ||
|
||
if [[ $? == 0 ]]; then | ||
CURRENT_PHP_UNIT=$RESULT | ||
echo "CURRENT_PHP_UNIT: $CURRENT_PHP_UNIT" | ||
else | ||
echo "CURRENT_PHP_UNIT: Not found." | ||
fi | ||
|
||
if [[ $PHP_VERSION == '5.6' ]]; then | ||
PHP_UNIT='5.7' | ||
elif [[ $PHP_VERSION == '7.0' ]]; then | ||
PHP_UNIT='6.5' | ||
elif [[ $PHP_VERSION == '7.1' ]]; then | ||
PHP_UNIT='7.5' | ||
elif [[ $PHP_VERSION == '7.2' ]]; then | ||
PHP_UNIT='8.5' | ||
elif [[ $PHP_VERSION == '7.3' || $PHP_VERSION == '7.4' || $PHP_VERSION == '8.0' ]]; then | ||
PHP_UNIT='9.5' | ||
fi | ||
|
||
if [[ $PHP_UNIT == '' ]]; then | ||
echo "Wrong PHP version: $PHP_VERSION" | ||
exit 1 | ||
fi | ||
|
||
if [[ $1 == '' && $CURRENT_PHP_UNIT == "$PHP_UNIT" ]]; then | ||
# Do nothing if current version of phpunit is the same as required. Important on CI. | ||
# Anytime force update available specifying the first argument like 'update-phpunit 7.0' | ||
echo "Nothing to do with phpunit." | ||
exit 0 | ||
fi | ||
|
||
# Restore test files to the current branch version. | ||
git checkout -- $TEST_DIR | ||
|
||
if [[ $PHP_UNIT == '5.7' || $PHP_UNIT == '6.5' || $PHP_UNIT == '7.5' ]]; then | ||
echo "Preparing tests for phpunit-$PHP_UNIT" | ||
find $TEST_DIR -type f -exec sed -i "s/: void//g" {} \; | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.1/phpunit.xsd" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
bootstrap="tests/_bootstrap.php" | ||
forceCoversAnnotation="true" | ||
forceCoversAnnotation="false" | ||
beStrictAboutCoversAnnotation="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
colors="true" | ||
verbose="true"> | ||
<testsuite> | ||
<testsuite name="function-mocker"> | ||
<directory suffix="Test.php">tests</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.