Download .zip |
Info | View files (234) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2018-03-17 (5 months ago) | Not yet rated by the users | Total: 131 | All time: 8,762 This week: 503 |
Version | License | PHP version | Categories | |||
rest-control 1.0.0 | MIT/X Consortium ... | 5 | HTTP, PHP 5, Web services, Testing |
Description | Author | ||||||||
This package can be used for testing and validating REST services. |
|
RestControl is modern and powerful framework for testing REST services. RestControl provides set of tools for describing HTTP requests and responses in expressive and elegant way.
Here is a simple example of how to send a GET request and validate json response:
/
* @test(
* title="Example test",
* description="Example test description",
* tags="find user"
* )
*/
public function exampleFindUser()
{
return send()->get('https://jsonplaceholder.typicode.com/users/1')
->expectedResponse()
->httpStatusOk()
->json()
->jsonPath('$.address.street', endsWith('Light'));
}
The best way for quick start is to use RestControl standalone application. You can find it here https://github.com/rest-control/standalone-testing-application. If you want to save yourself the hassle of installing dependencies required for this project on your local machine, you can use Docker containers as an alternative. Note that you will need Docker and Docker Compose in version >= 2.1.
To build and start RestControl standalone application, run following commands:
user@user:~/projects/standalone-testing-application$ make build
user@user:~/projects/standalone-testing-application$ make start
Now, you can use Docker machine and run example tests.
user@user:~/projects/standalone-testing-application$ docker exec -it restcontrol_cli_1 bash
user@machineid:/app# php vendor/bin/rest-control run
Thank you if you considering contributing to RestControl! The contribution guide will be available soon. Start watching this project to get regular updates.
All planned releases you can find here: https://github.com/rest-control/rest-control/milestones.
RestControl documentation is under construction, please be patient. Current documentation files are available on https://rest-control.github.io/
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (3 files) | ||||
bin (1 file) | ||||
src (1 file, 8 directories) | ||||
tests (2 files, 7 directories) | ||||
.coveralls.yml | Data | Auxiliary data | ||
.php_cs.dist | Example | Example script | ||
.travis.yml | Data | Auxiliary data | ||
appveyor.yml | Data | Auxiliary data | ||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
CONTRIBUTING.md | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
phpunit.xml.dist | Data | Auxiliary data | ||
README.md | Doc. | Documentation | ||
rest-control.yml-sample | Data | Auxiliary data |
Files | / | .github |
File | Role | Description |
---|---|---|
ISSUE_TEMPLATE.md | Data | Auxiliary data |
PULL_REQUEST_TEMPLATE.md | Data | Auxiliary data |
rest-control.jpg | Icon | Icon image |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
ApiClient (5 files) | ||||
Console (1 file, 2 directories) | ||||
Loader (4 files, 1 directory) | ||||
TestCase (9 files, 5 directories) | ||||
TestCasePipeline (5 files, 3 directories) | ||||
Traits (1 file) | ||||
Utils (4 files) | ||||
Validators (18 files) | ||||
helpers.php | Example | Example script |
Files | / | src | / | ApiClient |
File | Role | Description |
---|---|---|
ApiClientInterface.php | Class | Class source |
ApiClientRequest.php | Class | Class source |
ApiClientResponse.php | Class | Class source |
HttpGuzzleClient.php | Class | Class source |
MockApiClient.php | Class | Class source |
Files | / | src | / | Console |
File | Role | Description | ||
---|---|---|---|---|
Commands (3 files) | ||||
Utils (1 file) | ||||
Console.php | Class | Class source |
Files | / | src | / | Console | / | Commands |
File | Role | Description |
---|---|---|
CreateTestCaseCommand.php | Class | Class source |
HelpersTrait.php | Class | Class source |
RunTestsCommand.php | Class | Class source |
Files | / | src | / | Console | / | Utils |
File | Role | Description |
---|---|---|
ConsoleTestCasePipelineListener.php | Class | Class source |
Files | / | src | / | Loader |
File | Role | Description | ||
---|---|---|---|---|
Annotations (2 files) | ||||
LoaderInterface.php | Class | Class source | ||
PsrClassLoader.php | Class | Class source | ||
TestCaseDelegate.php | Class | Class source | ||
TestsBag.php | Class | Class source |
Files | / | src | / | Loader | / | Annotations |
File | Role | Description |
---|---|---|
AnnotationInterface.php | Class | Class source |
TestAnnotation.php | Class | Class source |
Files | / | src | / | TestCase |
File | Role | Description | ||
---|---|---|---|---|
ExpressionLanguage (10 files) | ||||
ResponseFilters (9 files, 1 directory) | ||||
StatsCollector (3 files) | ||||
Stubs (2 files) | ||||
Traits (4 files) | ||||
AbstractChain.php | Class | Class source | ||
AbstractTestCase.php | Class | Class source | ||
ChainObject.php | Class | Class source | ||
ChainTrait.php | Class | Class source | ||
Request.php | Class | Class source | ||
Response.php | Class | Class source | ||
ResponseFiltersBag.php | Class | Class source | ||
StubGenerator.php | Class | Class source | ||
TestCaseEventsInterface.php | Class | Class source |
Files | / | src | / | TestCase | / | ExpressionLanguage |
File | Role | Description |
---|---|---|
ContainsString.php | Class | Class source |
EachItems.php | Class | Class source |
EndsWith.php | Class | Class source |
EqualsTo.php | Class | Class source |
Expression.php | Class | Class source |
ExpressionValidatorInterface.php | Class | Class source |
LessThan.php | Class | Class source |
MoreThan.php | Class | Class source |
StartsWith.php | Class | Class source |
Validators.php | Class | Class source |
Files | / | src | / | TestCase | / | ResponseFilters |
File | Role | Description | ||
---|---|---|---|---|
HttpCodes (53 files) | ||||
AbstractFilter.php | Class | Class source | ||
FilterInterface.php | Class | Class source | ||
FilterTrait.php | Class | Class source | ||
HasItemFilter.php | Class | Class source | ||
HasItemsFilter.php | Class | Class source | ||
HeaderFilter.php | Class | Class source | ||
HttpCode.php | Class | Class source | ||
JsonFilter.php | Class | Class source | ||
JsonPathFilter.php | Class | Class source |
Files | / | src | / | TestCase | / | ResponseFilters | / | HttpCodes |
Files | / | src | / | TestCase | / | StatsCollector |
File | Role | Description |
---|---|---|
EndContextException.php | Class | Class source |
StatsCollector.php | Class | Class source |
StatsCollectorInterface.php | Class | Class source |
Files | / | src | / | TestCase | / | Stubs |
File | Role | Description |
---|---|---|
TestCase.php.stub | Class | Class source |
TestCaseMethod.php.stub | Data | Auxiliary data |
Files | / | src | / | TestCase | / | Traits |
File | Role | Description |
---|---|---|
RequestAuthTrait.php | Class | Class source |
RequestMethodsTrait.php | Class | Class source |
RequestTrait.php | Class | Class source |
ResponseHttpCodesTrait.php | Class | Class source |
Files | / | src | / | TestCasePipeline |
File | Role | Description | ||
---|---|---|---|---|
Adapters (1 file) | ||||
Events (6 files) | ||||
Stages (2 files) | ||||
Payload.php | Class | Class source | ||
TestCasePipeline.php | Class | Class source | ||
TestObject.php | Class | Class source | ||
TestPipelineConfiguration.php | Class | Class source | ||
TestSuiteObject.php | Class | Class source |
Files | / | src | / | TestCasePipeline | / | Adapters |
File | Role | Description |
---|---|---|
ApiClientRequestAdapter.php | Class | Class source |
Files | / | src | / | TestCasePipeline | / | Events |
File | Role | Description |
---|---|---|
AfterTestCaseEvent.php | Class | Class source |
AfterTestCasePipelineEvent.php | Class | Class source |
AfterTestsSuiteEvent.php | Class | Class source |
BeforeTestCaseEvent.php | Class | Class source |
BeforeTestCasePipelineEvent.php | Class | Class source |
BeforeTestsSuiteEvent.php | Class | Class source |
Files | / | src | / | TestCasePipeline | / | Stages |
File | Role | Description |
---|---|---|
PrepareTestsSuiteObjectsStage.php | Class | Class source |
RunTestObjectsStage.php | Class | Class source |
Files | / | src | / | Utils |
File | Role | Description |
---|---|---|
AbstractResponseItem.php | Class | Class source |
Arr.php | Class | Class source |
MockApiResponseInterface.php | Class | Class source |
ResponseItemsCollection.php | Class | Class source |
Files | / | src | / | Validators |
File | Role | Description |
---|---|---|
AbstractValidatorAdapter.php | Class | Class source |
ArrayValidatorAdapter.php | Class | Class source |
DateValidatorAdapter.php | Class | Class source |
EmailValidatorAdapter.php | Class | Class source |
Factory.php | Class | Class source |
FloatValidatorAdapter.php | Class | Class source |
HostnameValidatorAdapter.php | Class | Class source |
IBANValidatorAdapter.php | Class | Class source |
IntValidatorAdapter.php | Class | Class source |
IPValidatorAdapter.php | Class | Class source |
ISBNValidatorAdapter.php | Class | Class source |
LengthValidatorAdapter.php | Class | Class source |
NotEmptyValidatorAdapter.php | Class | Class source |
NumericValidatorAdapter.php | Class | Class source |
RegexValidatorAdapter.php | Class | Class source |
StringValidatorAdapter.php | Class | Class source |
URIValidatorAdapter.php | Class | Class source |
UUIDValidatorAdapter.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
ApiClient (1 file) | ||||
Loader (3 files, 1 directory) | ||||
TestCase (10 files, 3 directories) | ||||
TestCasePipeline (5 files, 3 directories) | ||||
Traits (1 file) | ||||
Utils (4 files) | ||||
Validators (16 files) | ||||
GlobalHelperTest.php | Class | Class source | ||
TestsBootstrap.php | Example | Example script |
Files | / | tests | / | Loader |
File | Role | Description | ||
---|---|---|---|---|
SamplePathWithTestsCase (2 files, 1 directory) | ||||
PsrClassLoaderTest.php | Class | Class source | ||
TestCaseDelegateTest.php | Class | Class source | ||
TestsBagTest.php | Class | Class source |
Files | / | tests | / | Loader | / | SamplePathWithTestsCase |
File | Role | Description | ||
---|---|---|---|---|
Rec (1 file, 1 directory) | ||||
SampleFile.php | Class | Class source | ||
SampleTest.php | Class | Class source |
Files | / | tests | / | Loader | / | SamplePathWithTestsCase | / | Rec |
File | Role | Description | ||
---|---|---|---|---|
Rec (1 file) | ||||
SampleTest.php | Class | Class source |
Files | / | tests | / | Loader | / | SamplePathWithTestsCase | / | Rec | / | Rec |
File | Role | Description |
---|---|---|
SampleTest.php | Class | Class source |
Files | / | tests | / | TestCase |
File | Role | Description | ||
---|---|---|---|---|
ExpressionLanguage (8 files) | ||||
ResponseFilters (10 files) | ||||
StatsCollector (1 file) | ||||
AbstractTestCaseTest.php | Class | Class source | ||
ChainObjectTest.php | Class | Class source | ||
ChainTraitTest.php | Class | Class source | ||
RequestTest.php | Class | Class source | ||
ResponseFiltersBagTest.php | Class | Class source | ||
ResponseTest.php | Class | Class source | ||
SampleTestCase.php | Class | Class source | ||
StubGeneratorTest.php | Class | Class source | ||
TestResponseChain.php | Class | Class source | ||
UnsupportedChain.php | Class | Class source |
Files | / | tests | / | TestCase | / | ExpressionLanguage |
File | Role | Description |
---|---|---|
ContainsStringTest.php | Class | Class source |
EachItemsTest.php | Class | Class source |
EndsWithTest.php | Class | Class source |
EqualsToTest.php | Class | Class source |
ExpressionTest.php | Class | Class source |
LessThanTest.php | Class | Class source |
MoreThanTest.php | Class | Class source |
StartsWithTest.php | Class | Class source |
Files | / | tests | / | TestCase | / | ResponseFilters |
File | Role | Description |
---|---|---|
FilterTraitTest.php | Class | Class source |
HasItemsTest.php | Class | Class source |
HasItemTest.php | Class | Class source |
HeaderFilterTest.php | Class | Class source |
HttpCodeTest.php | Class | Class source |
HttpPredefinedCodesTest.php | Class | Class source |
JsonFilterTest.php | Class | Class source |
JsonPathFilterTest.php | Class | Class source |
SampleResponseItem.php | Class | Class source |
SampleResponseItemAnother.php | Class | Class source |
Files | / | tests | / | TestCase | / | StatsCollector |
File | Role | Description |
---|---|---|
StatsCollectorTest.php | Class | Class source |
Files | / | tests | / | TestCasePipeline |
File | Role | Description | ||
---|---|---|---|---|
Adapters (1 file) | ||||
Events (6 files) | ||||
Stages (3 files) | ||||
PayloadTest.php | Class | Class source | ||
TestCasePipelineTest.php | Class | Class source | ||
TestObjectTest.php | Class | Class source | ||
TestPipelineConfigurationTest.php | Class | Class source | ||
TestSuiteObjectTest.php | Class | Class source |
Files | / | tests | / | TestCasePipeline | / | Adapters |
File | Role | Description |
---|---|---|
ApiClientRequestAdapterTest.php | Class | Class source |
Files | / | tests | / | TestCasePipeline | / | Events |
File | Role | Description |
---|---|---|
AfterTestCaseEventTest.php | Class | Class source |
AfterTestCasePipelineEventTest.php | Class | Class source |
AfterTestsSuiteEventTest.php | Class | Class source |
BeforeTestCaseEventTest.php | Class | Class source |
BeforeTestCasePipelineEventTest.php | Class | Class source |
BeforeTestsSuiteEventTest.php | Class | Class source |
Files | / | tests | / | TestCasePipeline | / | Stages |
File | Role | Description |
---|---|---|
AnotherTestCase.php | Class | Class source |
PrepareTestsSuiteObjectsStageTest.php | Class | Class source |
SampleTestCase.php | Class | Class source |
Files | / | tests | / | Utils |
File | Role | Description |
---|---|---|
AbstractResponseItemTest.php | Class | Class source |
ArrTest.php | Class | Class source |
ResponseItemsCollectionTest.php | Class | Class source |
SampleResponseItem.php | Class | Class source |
Files | / | tests | / | Validators |
File | Role | Description |
---|---|---|
ArrayValidatorAdapterTest.php | Class | Class source |
DateValidatorAdapterTest.php | Class | Class source |
EmailValidatorAdapterTest.php | Class | Class source |
FactoryTest.php | Class | Class source |
FloatValidatorAdapterTest.php | Class | Class source |
HostnameValidatorAdapterTest.php | Class | Class source |
IBANValidatorAdapterTest.php | Class | Class source |
IntValidatorAdapterTest.php | Class | Class source |
IPValidatorAdapterTest.php | Class | Class source |
ISBNValidatorAdapterTest.php | Class | Class source |
LengthValidatorAdapterTest.php | Class | Class source |
NotEmptyValidatorAdapterTest.php | Class | Class source |
NumericValidatorAdapterTest.php | Class | Class source |
RegexValidatorAdapterTest.php | Class | Class source |
StringValidatorAdapterTest.php | Class | Class source |
URIValidatorAdapterTest.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.