phramework / testphase
API testing environment build for phramework and RESTful APIs
Installs: 13 960
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 0
Open Issues: 24
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
- corneltek/getoptionkit: ~2
- phramework/exceptions: 0.*
- phramework/validate: 0.*
Requires (Dev)
- apigen/apigen: ^4.1
- league/commonmark: ^0.13.3
- phpunit/phpunit: 5.*
- satooshi/php-coveralls: dev-master
- squizlabs/php_codesniffer: *
This package is auto-updated.
Last update: 2024-11-28 23:01:15 UTC
README
API testing environment build for phramework and RESTful APIs
Usage
Require package using composer
composer require phramework/testphase
Execute tests written in JSON files using command line
./vendon/bin/testphase help -b ./bootstrap.php -d ./tests-directory/
Inside your bootstrap.php
file you MAY use the Testphase::setBase
method to set the base url of your API. For example: Testphase::setBase('http://localhost/myapp/api/');
Execute tests in PHP scripts
$test = (new Testphase( 'posts/notFound', 'GET', [ 'Accept: application/json' ] )) ->expectStatusCode(404) ->expectJSON() ->run();
Development
Install
composer update
Lint and test code
composer lint
composer test
Testing relies on JSONPlaceholder service.
Generate documentation
composer doc
License
Copyright 2015 - 2016 Xenofon Spafaridis
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.