Skip to content

Commit

Permalink
Empty PHP setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
codecop committed Mar 8, 2024
1 parent 587afbf commit 1daf4f2
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions php/.gitignore
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions php/composer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
1 change: 1 addition & 0 deletions php/phpunit.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@call "%~dp0vendor\bin\phpunit" %*
24 changes: 24 additions & 0 deletions php/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
backupGlobals="false"
bootstrap="./vendor/autoload.php"
colors="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="false"
beStrictAboutResourceUsageDuringSmallTests="true"
beStrictAboutTestsThatDoNotTestAnything="false"
beStrictAboutTodoAnnotatedTests="true"
beStrictAboutCoversAnnotation="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true">

<testsuites>
<testsuite name="All Tests">
<directory suffix="_test.php">test</directory>
<directory suffix="Test.php">test</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit 1daf4f2

Please sign in to comment.