|
@ -9,6 +9,7 @@ class ParseTest extends PHPUnit_Framework_TestCase { |
|
|
public function setUp() { |
|
|
public function setUp() { |
|
|
$this->client = new Parse(); |
|
|
$this->client = new Parse(); |
|
|
$this->client->http = new p3k\HTTPTest(dirname(__FILE__).'/data/'); |
|
|
$this->client->http = new p3k\HTTPTest(dirname(__FILE__).'/data/'); |
|
|
|
|
|
$this->client->mc = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private function parse($params) { |
|
|
private function parse($params) { |
|
@ -309,4 +310,19 @@ class ParseTest extends PHPUnit_Framework_TestCase { |
|
|
$this->assertEquals('Venue', $data['refs']['http://source.example.com/venue']['name']); |
|
|
$this->assertEquals('Venue', $data['refs']['http://source.example.com/venue']['name']); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function testEntryIsAnInvitee() { |
|
|
|
|
|
$url = 'http://source.example.com/bridgy-invitee'; |
|
|
|
|
|
$response = $this->parse(['url' => $url]); |
|
|
|
|
|
|
|
|
|
|
|
$body = $response->getContent(); |
|
|
|
|
|
$this->assertEquals(200, $response->getStatusCode()); |
|
|
|
|
|
$data = json_decode($body, true); |
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals('entry', $data['data']['type']); |
|
|
|
|
|
$this->assertEquals('https://www.facebook.com/555707837940351#tantek', $data['data']['url']); |
|
|
|
|
|
$this->assertContains('https://www.facebook.com/tantek.celik', $data['data']['invitee']); |
|
|
|
|
|
$this->assertArrayHasKey('https://www.facebook.com/tantek.celik', $data['refs']); |
|
|
|
|
|
$this->assertEquals('Tantek Çelik', $data['refs']['https://www.facebook.com/tantek.celik']['name']); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |