This is the TestingBot PHP client which makes it easy to interact with the TestingBot API
Testingbot-PHP is available under the Apache 2 license. See LICENSE.APACHE2
for more
details.
TestingBot-PHP is distributed with Composer, which means you can include it in your project:
composer require testingbot/testingbot-php
or edit the composer.json
file and add:
{
"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
$api = new TestingBot\TestingBotAPI($key, $secret);
Now you can use the various methods we've made available to interact with the API:
Gets a list of browsers you can test on
$api->getBrowsers();
Gets a list of devices you can test on
$api->getDevices();
Gets a list of available devices you can test on
$api->getAvailableDevices();
Gets information for a specific device
$api->getDevice($deviceID);
Gets your user information
$api->getUserInfo();
Updates your user information
$api->updateUserInfo(array('first_name' => 'test'));
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:
$api->updateJob($webdriverSessionID, array('name' => 'mytest', 'success' => true));
Gets meta information for a job (test) by passing in the WebDriver sessionID of the test you ran on TestingBot:
$api->getJob($webdriverSessionID);
Gets a list of previous jobs/tests that you ran on TestingBot, order by last run:
$api->getJobs(0, 10); // last 10 tests
Deletes a test from TestingBot
$api->deleteJob($webdriverSessionID);
Stops a running test on TestingBot
$api->stopJob($webdriverSessionID);
Gets a list of builds that you ran on TestingBot, order by last run:
$api->getBuilds(0, 10); // last 10 builds
Gets a build from TestingBot (a group of tests)
$api->getBuild($buildIdentifier);
Deletes a build from TestingBot.
$api->deleteBuild($buildIdentifier);
Gets a list of active tunnels for your account.
$api->getTunnels();
Deletes an active tunnel.
$api->deleteTunnel($tunnelID);
Uploads a local file (.apk, .ipa, .zip) to TestingBot Storage.
$api->uploadLocalFileToStorage($pathToLocalFile);
Uploads a remote file (.apk, .ipa, .zip) to TestingBot Storage.
$api->uploadRemoteFileToStorage($urlToRemoteFile);
Gets meta data from a file previously uploaded to TestingBot Storage.
AppUrl is the tb://
url you previously received from the TestingBot API.
$api->getStorageFile($appUrl);
Gets meta data from all file previously uploaded to TestingBot Storage.
$api->getStorageFiles();
Deletes a file previously uploaded to TestingBot Storage.
AppUrl is the tb://
url you previously received from the TestingBot API.
$api->deleteStorageFile($appUrl);
Calculates the hash necessary to share tests with other people
$api->getAuthenticationHash($identifier);