本文整理匯總了PHP中DashboardController::getClickStatsVisualizationData方法的典型用法代碼示例。如果您正苦於以下問題:PHP DashboardController::getClickStatsVisualizationData方法的具體用法?PHP DashboardController::getClickStatsVisualizationData怎麽用?PHP DashboardController::getClickStatsVisualizationData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DashboardController
的用法示例。
在下文中一共展示了DashboardController::getClickStatsVisualizationData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetClickStatsVisualizationData
public function testGetClickStatsVisualizationData()
{
$click_stats = array(array('post_text' => 'Black Mirror punched me in the gut this weekend. Highly recommended. http://t.co/AnczD4Jc ' . 'Thx @annaleen & @fraying', 'click_count' => 50), array('post_text' => '@saenz a geeky uncle's only <span class="googid">+Sprint</span> http://t.co/cxZTmWhk', 'click_count' => 150), array('post_text' => 'I\'ll admit Glee made me cry last night. Then it made me cringe. http://t.co/lgjaJWcW ', 'click_count' => 23));
$result = DashboardController::getClickStatsVisualizationData($click_stats);
$this->assertEqual(gettype($result), 'string');
$visualization_object = json_decode($result);
$this->assertEqual(sizeof($visualization_object->rows), 3);
$this->assertEqual(sizeof($visualization_object->cols), 2);
$this->assertEqual($visualization_object->cols[0]->label, 'Link');
$this->assertEqual($visualization_object->cols[1]->label, 'Clicks');
$this->assertEqual($visualization_object->rows[0]->c[0]->v, 'Black Mirror punched me in the gut this weekend. Highly recommended. http://t.co/AnczD4Jc Thx @annal...');
$this->assertEqual($visualization_object->rows[0]->c[1]->v, 50);
$this->assertEqual($visualization_object->rows[1]->c[0]->v, "@saenz a geeky uncle's only +Sprint http://t.co/cxZTmWhk...");
$this->assertEqual($visualization_object->rows[1]->c[1]->v, 150);
$this->assertEqual($visualization_object->rows[2]->c[0]->v, 'I\'ll admit Glee made me cry last night. Then it made me cringe. http://t.co/lgjaJWcW ...');
$this->assertEqual($visualization_object->rows[2]->c[1]->v, 23);
}