Skip to content

Commit

Permalink
Merge pull request #1581 from WPO-Foundation/test-test-1-2
Browse files Browse the repository at this point in the history
feat(unit tests): Add phpunit to our stuff
  • Loading branch information
jefflembeck authored Oct 14, 2021
2 parents d25651f + a62b4dc commit 8fdba23
Show file tree
Hide file tree
Showing 8 changed files with 2,182 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on: [push]

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: php-actions/composer@v5

- name: PHPUnit Tests
uses: php-actions/phpunit@v3
with:
configuration: tests/phpunit.xml
php_version: 7.4
php_extensions: gd
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,7 @@ www/settings/custom_metrics/meta-viewport.js
www/settings/custom_metrics/scriptTagCount.js
www/settings/common
www/settings/server
www/robots.txt
www/robots.txt

vendor
tests/*.cache
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ There are two examples using the [Restful API](https://docs.webpagetest.org/dev/

There are 2 separate lies of development under different licenses and pull requests are accepted to either of them. The master branch where most active development is occurring is under the [Polyform Shield 1.0.0 license](LICENSE.md) and there is an "apache" branch which is under the more permissive Apache 2.0 license.

## Testing the code

WebPageTest uses [PHPUnit](https://phpunit.de/index.html) to run unit tests. In
order to install PHPUnit and run the unit tests, you'll first need to install
[Composer](https://getcomposer.org/). From there, you can run `composer install`
and `composer test` to run the tests.

# Change Log

View the [WebPageTest Change Log](https://docs.webpagetest.org/change-log)
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require-dev": {
"phpunit/phpunit": "^9"
},
"scripts": {
"test": "phpunit --configuration tests/phpunit.xml"
}
}
Loading

0 comments on commit 8fdba23

Please sign in to comment.