public function testGetMediaPenetrationChartData() { $data = json_decode(getChartLineRangeViewsData(MongoUtils::getMediaPenetrationData("www.missmotz.de", $this->from, $this->to, 'daily'))); $this->assertEquals(292000, $data->views[0]); $this->assertEquals(3000, $data->clickbacks[0]); $this->assertEquals(intval(date('Y', strtotime($this->from))), $data->startdate->year); $this->assertEquals(intval(date('m', strtotime($this->from))) - 1, $data->startdate->month); $this->assertEquals(intval(date('d', strtotime($this->from))), $data->startdate->day); $data = json_decode(getChartLineRangeViewsData(MongoUtils::getMediaPenetrationData("www.missmotz.de", $this->from, $this->to, 'daily'), 'facebook')); $this->assertEquals(130000, $data->views[0]); $this->assertEquals(1000, $data->clickbacks[0]); $data = json_decode(getChartLineRangeViewsData(MongoUtils::getMediaPenetrationData("www.missmotz.de", $this->from, $this->to, 'daily'), 'twitter')); $this->assertEquals(66000, $data->views[0]); $this->assertEquals(1000, $data->clickbacks[0]); $data = json_decode(getChartLineRangeViewsData(MongoUtils::getMediaPenetrationData("www.missmotz.de", $this->from, $this->to, 'daily'), 'linkedin')); $this->assertEquals(82000, $data->views[0]); $this->assertEquals(1000, $data->clickbacks[0]); $data = json_decode(getChartLineRangeViewsData(MongoUtils::getMediaPenetrationData("www.missmotz.de", $this->from, $this->to, 'daily'), 'google')); $this->assertEquals(14000, $data->views[0]); $this->assertEquals(0, $data->clickbacks[0]); }
/** * component for description * * @author KM, HS * * @param sfWebRequest $request */ public function executeChart_column_mediapenetration_clickbacks(sfWebRequest $request) { $lDomainProfile = DomainProfileTable::getInstance()->find($this->pHostId); $this->pData = MongoUtils::getMediaPenetrationData($lDomainProfile->getUrl(), $this->pDateFrom, $this->pDateTo, $this->pAggregation); }