From 1daf4f219d61a419623a9d943e92fa8d4cb7abc4 Mon Sep 17 00:00:00 2001 From: Peter Kofler Date: Fri, 8 Mar 2024 16:31:23 +0100 Subject: [PATCH] Empty PHP setup. --- .github/workflows/php.yml | 31 +++++++++++++++++++++++++++++++ php/.gitignore | 21 +++++++++++++++++++++ php/composer.json | 23 +++++++++++++++++++++++ php/phpunit.bat | 1 + php/phpunit.xml | 24 ++++++++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 .github/workflows/php.yml create mode 100644 php/.gitignore create mode 100644 php/composer.json create mode 100644 php/phpunit.bat create mode 100644 php/phpunit.xml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..dc55290 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,31 @@ +name: Test PHP + +on: + push: + paths: + - 'php/**' + - '.github/workflows/php.yml' + pull_request: + paths: + - 'php/**' + - '.github/workflows/php.yml' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.3 + + - name: Set up dependencies + working-directory: php + run: composer install + + - name: Test + working-directory: php + run: ./vendor/bin/phpunit diff --git a/php/.gitignore b/php/.gitignore new file mode 100644 index 0000000..2e3c21f --- /dev/null +++ b/php/.gitignore @@ -0,0 +1,21 @@ +composer.bat +composer.phar +vendor/ + +# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +composer.lock + +# PHP Storm +.idea +*.iml +*.iwr + +# Eclipse files +.project +.buildpath +.settings + +# PHPUnit +coverage +.phpunit.result.cache diff --git a/php/composer.json b/php/composer.json new file mode 100644 index 0000000..23ea5d7 --- /dev/null +++ b/php/composer.json @@ -0,0 +1,23 @@ +{ + "name": "codecop/bank-ocr-refactoring-kata", + "require": { + "php": ">=7.3.0" + }, + "require-dev": { + "phpunit/phpunit": "9.6.*" + }, + "autoload": { + "psr-4": { + "Ocr\\": "src\/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "test\/" + } + }, + "scripts": { + "test": "phpunit", + "tests": "phpunit" + } +} \ No newline at end of file diff --git a/php/phpunit.bat b/php/phpunit.bat new file mode 100644 index 0000000..1eb3c41 --- /dev/null +++ b/php/phpunit.bat @@ -0,0 +1 @@ +@call "%~dp0vendor\bin\phpunit" %* diff --git a/php/phpunit.xml b/php/phpunit.xml new file mode 100644 index 0000000..79095ca --- /dev/null +++ b/php/phpunit.xml @@ -0,0 +1,24 @@ + + + + + + test + test + + +