本文整理汇总了PHP中TimeHelper::setDayOfYear方法的典型用法代码示例。如果您正苦于以下问题:PHP TimeHelper::setDayOfYear方法的具体用法?PHP TimeHelper::setDayOfYear怎么用?PHP TimeHelper::setDayOfYear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeHelper
的用法示例。
在下文中一共展示了TimeHelper::setDayOfYear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetClearDayOfYear
public function testSetClearDayOfYear()
{
$start = TimeHelper::getDayOfYear();
$this->assertNotEqual($start, 400);
//not more than 365 days in a year
TimeHelper::setDayOfYear(450);
$now = TimeHelper::getDayOfYear();
$this->assertEqual(450, $now);
TimeHelper::clearDayOfYear();
$now = TimeHelper::getDayOfYear();
$this->assertNotEqual(450, $now);
}
示例2: testMandrillHTMLDailyPaymentDue
public function testMandrillHTMLDailyPaymentDue()
{
unlink(FileDataManager::getDataPath(Mailer::EMAIL));
$plugin = new InsightsGeneratorPlugin();
$config = Config::getInstance();
$config->setValue('mandrill_api_key', '1234');
$config->setValue('thinkupllc_endpoint', 'http://example.com/thinkup/');
$plugin_dao = DAOFactory::getDAO('PluginDAO');
$plugin_id = $plugin_dao->getPluginId($plugin->folder_name);
$plugin_option_dao = DAOFactory::GetDAO('PluginOptionDAO');
$long_ago = date('Y-m-d', strtotime('-7 day'));
$plugin_option_dao->insertOption($plugin_id, 'mandrill_template', $template = 'my_template');
$plugin_option_dao->insertOption($plugin_id, 'last_daily_email', $long_ago);
$options = $plugin_option_dao->getOptionsHash($plugin->folder_name, true);
$builders = self::buildDataForDailyEmailFreeTrial();
$i = 0;
while ($i < 5) {
$owner_builder = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp Q. User', 'is_admin' => 1, 'email' => 'paymentdue@example.com', 'is_activated' => 1, 'email_notification_frequency' => 'daily', 'timezone' => 'America/New_York', 'is_free_trial' => 0, 'joined' => '-' . $i . 'd', 'membership_level' => 'Member'));
$this->simulateLogin('paymentdue@example.com');
$plugin->current_timestamp = strtotime('5pm');
//Cycle through the 5 copy options for when a payment fails
TimeHelper::setDayOfYear($i);
$plugin->crawl();
$sent = Mailer::getLastMail();
$merge_vars = array();
$decoded = json_decode($sent);
foreach ($decoded->global_merge_vars as $mv) {
$merge_vars[$mv->name] = $mv->content;
}
$html_email = $merge_vars['insights'];
$this->debug($html_email);
$this->assertPattern('/Update your payment info/', $html_email);
unlink(FileDataManager::getDataPath(Mailer::EMAIL));
$plugin_option_dao->updateOption($options['last_daily_email']->id, 'last_daily_email', $long_ago);
$owner_builder = null;
$i++;
}
}