Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

name: Test

jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
include:
- operating-system: ubuntu-latest
php: 7.4
phpunit: 8
- operating-system: ubuntu-latest
php: 8.4
phpunit: 9
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
- uses: php-actions/phpunit@v3
with:
configuration: phpunit.xml.dist
version: ${{ matrix.phpunit }}
php_version: ${{ matrix.php }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*~
.idea/
extern/
vendor/
bin/phpunit
bin/civistrings.phar
Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,24 @@ civistrings -o myfile.pot myfolder
find -name '*.js' | civistrings - -o myfile.pot
```

## Development and Testing
## Development

The "examples" folder includes a series of example input files and expected
output files. To see if the examples are correctly processed, simply run
`phpunit`.
For a full set of development and testing activities, you will need:

If you need to add new examples or change the behavior of the test, update
`tests/Command/ExtractCommandTest.php`.
* [`git`](https://git-scm.com)
* [`composer`](https://getcomposer.org/)
* [`box`](http://box-project.github.io/box2/)
* [`phpunit`](https://phpunit.de/)

> __TIP__: If you use `nix-shell`, it will provide `php`, `git`, `composer`,
> `box`, `phpunit8`, and `phpunit9`.

### Testing

Tests are based on a series of example files (e.g. `./examples/ex1.php` and
the corresponding `./examples/ex1.pot`).

To run the tests, simply call your favorite instance of `phpunit`.

### Build

Expand Down
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@
"php": "7.4.0"
},
"bin-dir": "bin"
},
"require-dev": {
"phpunit/phpunit": "9.6.*"
}
}
Loading