Testingbot-PHP
This is the TestingBot PHP client which makes it easy to
interact with the TestingBot API, (*1)
License
Testingbot-PHP is available under the Apache 2 license. See LICENSE.APACHE2
for more
details., (*2)
Usage
TestingBot-PHP is distributed with Composer, which means you can include it in your project:, (*3)
composer require testingbot/testingbot-php
, (*4)
or edit the composer.json
file and add:, (*5)
{
"require": {
"testingbot/testingbot-php": ">=1.0.0"
}
}
To start, create a new TestingBot\TestingBotAPI
object and pass in the key and secret you obtained from TestingBot, (*6)
$api = new TestingBot\TestingBotAPI($key, $secret);
Now you can use the various methods we've made available to interact with the API:, (*7)
getBrowsers
Gets a list of browsers you can test on, (*8)
$api->getBrowsers();
getDevices
Gets a list of devices you can test on, (*9)
$api->getDevices();
getAvailableDevices
Gets a list of available devices you can test on, (*10)
$api->getAvailableDevices();
getDevice
Gets information for a specific device, (*11)
$api->getDevice($deviceID);
getUserInfo
Gets your user information, (*12)
$api->getUserInfo();
updateUserInfo
Updates your user information, (*13)
$api->updateUserInfo(array('first_name' => 'test'));
updateJob
Updates a Test with Meta-data to display on TestingBot.
For example, you can specify the test name and whether the test succeeded or failed:, (*14)
$api->updateJob($webdriverSessionID, array('name' => 'mytest', 'success' => true));
getJob
Gets meta information for a job (test) by passing in the WebDriver sessionID of the test you ran on TestingBot:, (*15)
$api->getJob($webdriverSessionID);
getJobs
Gets a list of previous jobs/tests that you ran on TestingBot, order by last run:, (*16)
$api->getJobs(0, 10); // last 10 tests
deleteJob
Deletes a test from TestingBot, (*17)
$api->deleteJob($webdriverSessionID);
stopJob
Stops a running test on TestingBot, (*18)
$api->stopJob($webdriverSessionID);
getBuilds
Gets a list of builds that you ran on TestingBot, order by last run:, (*19)
$api->getBuilds(0, 10); // last 10 builds
getBuild
Gets a build from TestingBot (a group of tests), (*20)
$api->getBuild($buildIdentifier);
deleteBuild
Deletes a build from TestingBot., (*21)
$api->deleteBuild($buildIdentifier);
getTunnels
Gets a list of active tunnels for your account., (*22)
$api->getTunnels();
deleteTunnel
Deletes an active tunnel., (*23)
$api->deleteTunnel($tunnelID);
uploadLocalFileToStorage
Uploads a local file (.apk, .ipa, .zip) to TestingBot Storage., (*24)
$api->uploadLocalFileToStorage($pathToLocalFile);
uploadRemoteFileToStorage
Uploads a remote file (.apk, .ipa, .zip) to TestingBot Storage., (*25)
$api->uploadRemoteFileToStorage($urlToRemoteFile);
getStorageFile
Gets meta data from a file previously uploaded to TestingBot Storage.
AppUrl is the tb://
url you previously received from the TestingBot API., (*26)
$api->getStorageFile($appUrl);
getStorageFiles
Gets meta data from all file previously uploaded to TestingBot Storage., (*27)
$api->getStorageFiles();
deleteStorageFile
Deletes a file previously uploaded to TestingBot Storage.
AppUrl is the tb://
url you previously received from the TestingBot API., (*28)
$api->deleteStorageFile($appUrl);
getAuthenticationHash
Calculates the hash necessary to share tests with other people, (*29)
$api->getAuthenticationHash($identifier);