REST API is a new standard for web applications. For single page applications, for mobile application and for 3rd party clients application should provide a public API. This API should be reliable and it means it must be heavily tested. Codeception testing framework allows to test API on the most suitable level, emulating HTTP requests using a PHP framework, or sending real HTTP calls to a webserver. Students will learn how to test JSON and XML responses by data and structure, how to pass authorization and more.
Develop API in a test driven manner, before the code to test them without using manual test tools like Postman.
Target Audience:
Engineers
Workshop agenda:
General overview
General overview for testing levels
Whitebox testing vs Blackbox testing
REST APIs and PHP
Testing REST API
Setting up Codeception for API tests
TDD for API development
Testing API contracts
Validating API response
Testing 3rd Party API
Sending and validating complex requests
Authorization
Using PHP-VCR
Data Management
Generating test data using data factories.
Data cleanup between tests