Coder Social home page Coder Social logo

sdk-php's Introduction

LiveIntent SDK PHP

Test Latest Stable Version License

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.

Getting started

First clone the repository. Then, run cp .env.example .env to create the env file.

Finally install the dependencies via:

composer install

Testing

To run the unit tests

composer test

Mocking

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.

Test in record mode

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.

Test using recorded responses

To run the tests against a live api connection and record the results run:

composer test

Alternative methods of mocking

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.

Linting

The installed linter will auto-format your code to comply with our agreed php coding standard.

To run the linter

composer lint

sdk-php's People

Contributors

ashishkumarqait avatar chintan-liveintent avatar jiechaowang avatar rrmanalo623 avatar tam5 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.