-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTwitterSearchTest.php
36 lines (28 loc) · 856 Bytes
/
TwitterSearchTest.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
<?php
require_once( 'TwitterSearch.php' );
class TestTwitter extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->twitter = new twitterSearch();
}
public function testSearch()
{
// authenticate using OAuth creds
$this->twitter->authenticate( 'xlN7UWnd2FLWp4oxrtAA', 'nywpCALJ3ZXnlHnPwdGRmnu0jIqAbUBHhauPRCuPzMM' );
// search for the word 'test'
$result = $this->twitter->search( "test" );
// check that results were returned
$this->assertTrue( !empty( $result ) );
// check that tweets were found
$this->assertTrue( $result->statuses > 5 );
// invalidate the token
$this->twitter->unauthenticate();
}
/**
*
*/
public function tearDown()
{
}
}