Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
christeredvartsen committed May 25, 2021
2 parents b5ac05c + 1c9c4ab commit 01db017
Show file tree
Hide file tree
Showing 59 changed files with 6,160 additions and 2,968 deletions.
10 changes: 9 additions & 1 deletion .github/CONTRIBUTING.md
Expand Up @@ -2,7 +2,7 @@

If you want to contribute to the Behat API Extension please follow the following guidelines.

## Running tests
## Running tests and static analysis

Behat API Extension has both [Behat](http://docs.behat.org/) and [PHPUnit](https://phpunit.de/) tests, and when adding new features or fixing bugs you are required to add relevant test cases.

Expand All @@ -23,6 +23,14 @@ If you want to run the suites separately they can be executed like this:
./vendor/bin/behat --strict
./vendor/bin/phpunit

PHPStan is used for static code analysis, and a composer script has been added to run this tool:

composer run sa

You can also run both test suites along with the static analysis with a single composer script:

composer run ci

## Documentation

The extension uses [Sphinx](http://www.sphinx-doc.org/en/stable/) for documentation, and all end-user documentation resides in the `docs` directory. To generate the current documentation after checking out your fork simply run the `docs` composer script:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,54 @@
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0']
name: Validate, lint and test on PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Debug PHP installation
run: |
php -v
php -i
php -m
- name: Validate composer files
run: composer validate --strict

- name: Lint all PHP files
run: composer run lint

- name: Get Composer cache directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install

- name: Start dev server
run: composer run dev --timeout=0 &

- name: Run tests
run: composer run test

- name: Run static code analysis
run: composer run sa
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,5 @@ server.log
phpunit.xml
docs/_build
.idea
.phpunit.result.cache
.vscode
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

20 changes: 20 additions & 0 deletions ChangeLog.md
@@ -1,6 +1,26 @@
Changelog for Behat API Extension
=================================

v3.0.0
------
__2021-05-25__

* [#101](https://github.com/imbo/behat-api-extension/issues/101): Require PHP >= 7.4
* [#92](https://github.com/imbo/behat-api-extension/pull/92): Add password grant OAuth step ([@ABGEO](https://github.com/ABGEO))
* [#85](https://github.com/imbo/behat-api-extension/pull/85): Add support for manipulating query parameters using steps

v2.3.1
------
__2020-01-29__

* Minor docs fix and bumped copyright year

v2.3.0
------
__2020-01-29__

* [#84](https://github.com/imbo/behat-api-extension/pull/84): Added support for `any` and multiple variable types with the `@variableType` matcher

v2.2.1
------
__2019-09-15__
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2016-2019, Christer Edvartsen <cogo@starzinger.net>
Copyright (c) Christer Edvartsen <cogo@starzinger.net>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
Expand Down
6 changes: 2 additions & 4 deletions README.md
@@ -1,6 +1,6 @@
# Behat API Extension

[![Current build Status](https://secure.travis-ci.org/imbo/behat-api-extension.png)](http://travis-ci.org/imbo/behat-api-extension)
![Current build Status](https://github.com/imbo/behat-api-extension/workflows/CI/badge.svg)

This Behat extension provides an easy way to test JSON-based API's in [Behat 3](http://behat.org). Inspired by [behat/web-api-extension](https://github.com/Behat/WebApiExtension/) and originally written to test the [Imbo API](http://imbo.io).

Expand All @@ -10,6 +10,4 @@ End-user docs can be found [here](https://behat-api-extension.readthedocs.io/).

## Copyright / License

Copyright (c) 2016-2019, Christer Edvartsen <cogo@starzinger.net>

Licensed under the MIT License
Licensed under the [MIT license](LICENSE).
46 changes: 31 additions & 15 deletions composer.json
Expand Up @@ -20,17 +20,22 @@
"irc": "irc://irc.freenode.net/imbo"
},
"require": {
"php": ">=5.6",
"behat/behat": "^3.0",
"guzzlehttp/guzzle": "^6.0",
"beberlei/assert": "^2.1",
"firebase/php-jwt": "^4.0 | ^5.0"
"php": "^7.4 || ^8.0",
"ext-json": "*",
"beberlei/assert": "^3.3",
"behat/behat": "^3.8",
"firebase/php-jwt": "^5.2",
"guzzlehttp/guzzle": "^7.3"
},
"require-dev": {
"silex/silex": "^2.0",
"symfony/security": "^3.1",
"symfony/process": "^3.1",
"phpunit/phpunit": "^5.5"
"alexeyshockov/guzzle-psalm-plugin": "^0.3.1",
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.15.1",
"slim/psr7": "^1.3",
"slim/slim": "^4.7",
"symfony/process": "^5.2",
"tuupola/slim-basic-auth": "^3.3",
"vimeo/psalm": "^4.7"
},
"autoload": {
"psr-4": {
Expand All @@ -43,16 +48,27 @@
}
},
"scripts": {
"clean": "rm -rf build",
"lint": "for file in `git ls-files '*php'`; do php -l $file; done",
"test-phpunit": "vendor/bin/phpunit",
"test-phpunit-coverage": "vendor/bin/phpunit --coverage-html build/coverage",
"test-behat": "vendor/bin/behat --strict",
"phpunit": "vendor/bin/phpunit",
"phpunit:coverage": "vendor/bin/phpunit --coverage-html build/coverage",
"behat": "vendor/bin/behat --strict",
"psalm": "vendor/bin/psalm",
"test": [
"@test-phpunit",
"@test-behat"
"@phpunit",
"@behat"
],
"sa": [
"@psalm"
],
"ci": [
"@lint",
"@test",
"@sa"
],
"dev": "php -S localhost:8080 -t ./features/bootstrap > server.log 2>&1",
"docs": "cd docs; make html"
},
"config": {
"sort-packages": true
}
}

0 comments on commit 01db017

Please sign in to comment.