-
Notifications
You must be signed in to change notification settings - Fork 0
/
3taps_test.php
57 lines (41 loc) · 1.18 KB
/
3taps_test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?
DEFINE('API_KEY', '75c8e3851e874fe692a8199022a06645');
require('3taps.php');
require('simpletest/autorun.php');
class TestOfSearchClient extends UnitTestCase {
private $client;
private $params = array(
'rpp' => 4,
'text' => 'honda',
'source' => 'CRAIG'
);
function __construct() {
parent::__construct('3taps Search API test');
$this->client = new threeTapsClient(API_KEY);
$this->client->debug = true;
}
function testSearch() {
$results = $this->client->search->search($this->params);
$this->assertTrue($results['numResults'] > 0);
}
function testSummary() {
$results = $this->client->search->summary($this->params);
$this->assertTrue($results['totals'] > 0);
}
function testCount() {
$result = $this->client->search->count($this->params);
$this->assertTrue(count($result['count']) > 0);
}
}
class TestOfReferenceClient extends UnitTestCase {
private $client;
function __construct() {
parent::__construct('3taps Reference API test');
$this->client = new threeTapsClient(API_KEY);
$this->client->debug = true;
}
function testCategories() {
$results = $this->client->reference->categories();
$this->assertTrue(count($results) > 0);
}
}