コード例 #1
0
ファイル: GraphObjectTest.php プロジェクト: chenbingchn/demos
 public function testAsList()
 {
     $backingData = array('data' => array(array('id' => 1, 'name' => 'David'), array('id' => 2, 'name' => 'Fosco')));
     $enc = json_encode($backingData);
     $response = new FacebookResponse(null, json_decode($enc), $enc);
     $list = $response->getGraphObjectList(GraphUser::className());
     $this->assertEquals(2, count($list));
     $this->assertTrue($list[0] instanceof GraphObject);
     $this->assertTrue($list[1] instanceof GraphObject);
     $this->assertEquals('David', $list[0]->getName());
     $this->assertEquals('Fosco', $list[1]->getName());
 }