-
Notifications
You must be signed in to change notification settings - Fork 11
/
example_test.php
34 lines (28 loc) · 969 Bytes
/
example_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
<?php
require_once dirname(__FILE__).'/../test_helper.php';
class PublisherIntegrationTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
}
public function testGetPublishers()
{
$publishers = $this->gnip->getPublishers();
assertContains($this->publisher, $publishers);
}
public function testGetPublisher()
{
$this->assertEquals($this->gnip->getPublisher("bob"), $this->publisher);
}
public function testPublishActivities()
{
// DATE_ISO8601 gives us 2008-07-15T15:42:47-0700
// DATE_ATOM gives us 2008-07-15T15:43:46-07:00
$atString = date_create()->format(DATE_ATOM);
$activity = new Services_Gnip_Activity($atString,'added_friend','foo/bob1');
$this->gnip->publish($this->publisher, array($activity));
$activities = $this->gnip->getActivities($this->publisher);
assertContains($activity, $activities);
}
}
?>