本文整理汇总了PHP中Piwik_Date::yesterday方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_Date::yesterday方法的具体用法?PHP Piwik_Date::yesterday怎么用?PHP Piwik_Date::yesterday使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_Date
的用法示例。
在下文中一共展示了Piwik_Date::yesterday方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDayIsFinishedYesterday
/**
* yesterday 23:59:59 is finished
* @group Core
* @group Period
* @group Period_Day
*/
public function testDayIsFinishedYesterday()
{
$period = new Piwik_Period_Day(Piwik_Date::yesterday());
$this->assertEquals(date("Y-m-d", time() - 86400), $period->toString());
$this->assertEquals(array(), $period->getSubperiods());
$this->assertEquals(0, $period->getNumberOfSubperiods());
}
示例2: testRangePrevious3days
/**
* @group Core
* @group Period
* @group Period_Range
*/
public function testRangePrevious3days()
{
$range = new Piwik_Period_Range('day', 'previous3');
$yesterday = Piwik_Date::yesterday();
$correct = array();
for ($i = 0; $i < 3; $i++) {
$correct[] = $yesterday->subDay($i)->toString();
}
$correct = array_reverse($correct);
$this->assertEquals(3, $range->getNumberOfSubperiods());
$this->assertEquals($correct, $range->toString());
}
示例3: testYesterday
/**
* create today object check that timestamp is correct (midnight)
*
* @group Core
* @group Date
*/
public function testYesterday()
{
$date = Piwik_Date::yesterday();
$this->assertEquals(strtotime(date("Y-m-d", strtotime('-1day')) . " 00:00:00"), $date->getTimestamp());
}
示例4: test_range_previous3days
function test_range_previous3days()
{
$range = new Piwik_Period_Range('day', 'previous3');
$yesterday = Piwik_Date::yesterday();
$correct = array();
for ($i = 0; $i < 3; $i++) {
$correct[] = $yesterday->subDay($i)->toString();
}
$correct = array_reverse($correct);
$this->assertEqual($range->getNumberOfSubperiods(), 3);
$this->assertEqual($range->isFinished(), true);
$this->assertEqual($range->toString(), $correct);
}
示例5: test_yesterday
function test_yesterday()
{
$date = Piwik_Date::yesterday();
$this->assertEqual(strtotime(date("Y-m-d", time() - 86400) . " 00:00:00"), $date->get());
}