1. Go to this page and download the library: Download wilddogserver/huang library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
public function setWilddogValue($path, $value) {
$wilddog = new Wilddog('https://testing.wilddogio.com', 'xVUeUTLjTye5cS4ugiG6C5BStV0deHgfsCi6SG6W');
$wilddog->set($path, $value);
}
public function setWilddogValue($path, $value, $wilddog) {
$result = $wilddog->set($path, $value)
if ($result == null && $value != null) {
//若为null 则需要判断是否出现了异常
//只有set的$value为null时 set($path,$value)返回null
//其他情况为请求异常 需要用户进行判断重试
}
}
re_once '<path>/lib/wilddogStub.php';
class MyClass extends PHPUnit_Framework_TestCase
{
public function testSetWilddogValue() {
$myClass = new MyClass();
$wilddogStub = new WilddogStub($uri, $token);
$myClass->setWilddogValue($path, $value, $wilddogStub);
}
}
bash
$ phpunit test/wilddogTest.php
bash
$ phpunit test/wilddogStubTest.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.