本文整理汇总了PHP中Piwik\Tests\Framework\Fixture::createWebsite方法的典型用法代码示例。如果您正苦于以下问题:PHP Fixture::createWebsite方法的具体用法?PHP Fixture::createWebsite怎么用?PHP Fixture::createWebsite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Tests\Framework\Fixture
的用法示例。
在下文中一共展示了Fixture::createWebsite方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
FakeAccess::$superUser = true;
$idSite = Fixture::createWebsite('2014-01-01 00:00:00');
$this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll', 'idSite' => $idSite));
}
示例2: setUp
public function setUp()
{
parent::setUp();
Fixture::createWebsite('2014-01-01 00:00:00');
$this->tracker = new TestTracker();
$this->request = $this->buildRequest(array('idsite' => 1));
}
示例3: setUp
public function setUp()
{
parent::setUp();
// setup the access layer
FakeAccess::$superUser = true;
Fixture::createWebsite('2015-01-01 00:00:00');
}
示例4: setUp
public function setUp()
{
// add one thousand sites
$allIdSites = array();
for ($i = 0; $i < 1000; ++$i) {
$allIdSites[] = Fixture::createWebsite($this->date, $ecommerce = 1, $siteName = "Site #{$i}");
}
$urls = array();
for ($i = 0; $i != 3; ++$i) {
$url = "http://whatever.com/" . ($i - 1) . "/" . ($i + 1);
$title = "page view " . ($i - 1) . " / " . ($i + 1);
$urls[$url] = $title;
}
$visitTimes = array();
$date = Date::factory($this->date);
for ($i = 0; $i != 4; ++$i) {
$visitTimes[] = $date->addHour($i)->getDatetime();
}
// add 12000 visits (3 visitors with 4 visits each for each site) w/ 3 pageviews each on one day
foreach ($visitTimes as $visitTime) {
foreach ($allIdSites as $idSite) {
for ($visitor = 0; $visitor != 3; ++$visitor) {
$t = BenchmarkTestCase::getLocalTracker($idSite);
$ip = "157.5.6." . ($visitor + 1);
$t->setIp($ip);
$t->setNewVisitorId();
$t->setForceVisitDateTime($visitTime);
foreach ($urls as $url => $title) {
$t->setUrl($url);
$t->doTrackPageView($title);
}
}
}
}
}
示例5: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
Fixture::createWebsite('2012-01-01 00:00:00');
Fixture::createWebsite('2012-01-01 00:00:00');
Fixture::createWebsite('2012-01-01 00:00:00');
}
示例6: setUp
public function setUp()
{
parent::setUp();
$this->idSite = Fixture::createWebsite('2012-01-01 00:00:00');
$this->formatter = new SegmentFormatter(new SegmentList());
Translate::loadAllTranslations();
}
示例7: setUp
public function setUp()
{
parent::setUp();
if (!Fixture::siteCreated($this->idSite)) {
Fixture::createWebsite('2014-01-01 00:00:00');
}
}
示例8: setUp
public function setUp()
{
// add one site
Fixture::createWebsite($this->date, $ecommerce = 1, $siteName = "Site #0", $siteUrl = "http://whatever.com/");
// add two goals
$goals = API::getInstance();
$goals->addGoal($this->idSite, 'all', 'url', 'http', 'contains', false, 5);
$goals->addGoal($this->idSite, 'all', 'url', 'thing2', 'contains');
$start = Date::factory($this->date);
$dates = array();
for ($day = 0; $day != 31; ++$day) {
$dates[] = $start->addDay($day);
}
$t = BenchmarkTestCase::getLocalTracker($this->idSite);
$actionNum = 0;
foreach ($dates as $date) {
for ($visitNum = 0; $visitNum != 1000; ++$visitNum) {
if ($visitNum % 2 == 0) {
$url = "http://whatever.com/{$actionNum}/0/1/2/3/4/5/6/7/8/9";
$referrerUrl = "http://google.com/?q={$actionNum}";
} else {
$url = "http://whatever.com/thing2/{$actionNum}/0/1/2/3/4/5/6/7/8/9";
$referrerUrl = "http://";
}
$title = "A page title / {$actionNum} / 0 / 1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 /9";
$t->setNewVisitorId();
$t->setForceVisitDateTime($date);
$t->setUrl($url);
$t->setUrlReferrer($referrerUrl);
Fixture::checkResponse($t->doTrackPageView($title));
++$actionNum;
}
}
}
示例9: setUp
public function setUp()
{
parent::setUp();
$this->tracker = new TestIntegrationTracker();
Fixture::createWebsite('2014-01-01 00:00:00');
Fixture::createWebsite('2014-01-01 00:00:00');
$this->injectRawDataToBulk($this->getDummyRequest());
}
示例10: setUp
public function setUp()
{
parent::setUp();
for ($i = 1; $i <= $this->numSitesToCreate; $i++) {
Fixture::createWebsite('2012-12-12 00:00:00', $ecommerce = 0, 'Site ' . $i);
}
$this->dashboard = $this->getMockBuilder('Piwik\\Plugins\\MultiSites\\Dashboard')->setMethods(null)->disableOriginalConstructor()->getMock();
}
示例11: setUp
public function setUp()
{
parent::setUp();
Fixture::createWebsite('2014-01-01 00:00:00');
Fixture::createWebsite('2014-01-01 00:00:00');
Cache::deleteTrackerCache();
$_SERVER['HTTP_USER_AGENT'] = '';
}
示例12: setUp
public function setUp()
{
parent::setUp();
if (!Fixture::siteCreated(1)) {
Fixture::createWebsite('2015-01-01 00:00:00');
}
$this->channels = new Plugin\ReleaseChannels(StaticContainer::get('Piwik\\Plugin\\Manager'));
}
示例13: setUp
public function setUp()
{
parent::setUp();
if (!Fixture::siteCreated(1)) {
Fixture::createWebsite('2014-01-01 00:00:00');
}
$this->index = new Index();
}
示例14: setUp
public function setUp()
{
parent::setUp();
// setup the access layer
FakeAccess::$superUser = true;
$this->manager = new SitesManager();
$this->siteId = Fixture::createWebsite('2014-03-03 00:00:00');
}
示例15: setUp
public function setUp()
{
parent::setUp();
$this->plugin = new VisitsSummary();
$this->setSuperUser();
Fixture::createSuperUser();
Fixture::createWebsite('2014-01-01 00:00:00');
}