当前位置: 首页>>代码示例>>PHP>>正文


PHP DashboardController::getClickStatsVisualizationData方法代码示例

本文整理汇总了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&#39;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);
 }
开发者ID:rudimk,项目名称:Outro,代码行数:17,代码来源:TestOfDashboardController.php


注:本文中的DashboardController::getClickStatsVisualizationData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。