The LiveIntent PHP SDK provides a convenient way to interact with the LiveIntent API in PHP applications.
This document describes how to develop the SDK itself. For usage documentation and examples see usage.
First clone the repository. Then, run cp .env.example .env
to create the env file.
Finally install the dependencies via:
composer install
To run the unit tests
composer test
When testing you often want to mock external api calls, but you also want to be confident that those api calls will work in the real world.
To solve this, you may instruct the client to record the request/response pairs it makes. This allows you to run your tests against a live version of the api when necessary, and to reuse those same responses when mocking is acceptable for faster, more predictable and reliable tests.
To run the tests against a live api connection and record the results run:
composer test-record
By default recordings will be saved in the file tests/__snapshots__/snapshot
.
To run the tests against a live api connection and record the results run:
composer test
The LiveIntent client inherits from Laravel's Http Client. Therefore, all the methods available to that client are also be available.
For detailed documentation see here.
The installed linter will auto-format your code to comply with our agreed php coding standard.
To run the linter
composer lint