Download the PHP package apsconnect/connect-quickstart-template without Composer
On this page you can find all versions of the php package apsconnect/connect-quickstart-template. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download apsconnect/connect-quickstart-template
More information about apsconnect/connect-quickstart-template
Files in apsconnect/connect-quickstart-template
Package connect-quickstart-template
Short Description APS Connect QuickStart Template
License proprietary
Homepage http://www.ingrammicrocloud.com/
Informations about the package connect-quickstart-template
Connect SDK Template for PHP
The Connect SDK Template for php provides developers an complete skeleton to start their automation project using the Connect Fulfillment API together with the Connect SDK for PHP.
Requirements
In order to use this template you will need an environment capable to run PHP scripts, any version starting PHP 5.6 is supported. Additionally please ensure that composer it's functional.
Installation
You can download the quick start template with Composer create-project command in your terminal:
Once you have the skeleton project ready you can start developing your custom code
in app/ProductFulfillment.php file in the processRequest() method.
Testing your project
Test the ProductFulfillment class is quite easy, you just need to create your tests in tests/Feature/ directory
by default the skeleton have some common tests.
Mocking the FulFillment API calls
To mock the fulfillment API, and with that test like if a request is retrived, you only have to create a valid json file with the response that you want in the tests/Feature/
directory with the name YOUR-TEST-NAME.http.json where YOUR-TEST-NAME is the name of the test file in where you want to
use that fake response, for example:
ProcessSkipTest.http.jsonwill be injected inProcessSkipTest.phptest.RunAndFailTest.http.jsonwill be injected inRunAndFailTest.phptest.
Mocking other services
The skeleton also provides a easy way to mock other services, for this you only need to create a new service provider in
tests/Providers, this new service provider MUST extends the MockServiceProvider. Inside this file you should configure
your mocked service using the static property $scope to retrieve any auxiliary file like a fake json.
Finally you need to register your mocked service in the $providers property of tests/TestCase file.
The scope id has the format YOUR-TEST-NAME.serviceId.json where:
YOUR-TEST-NAMEis the filename of the test that is running.serviceIdis the id of the service for exampleloggeris the logger service id andhttpis the default Http service for the FulFillment API.