當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TimeHelper::setDayOfYear方法代碼示例

本文整理匯總了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);
 }
開發者ID:pepeleproso,項目名稱:ThinkUp,代碼行數:12,代碼來源:TestOfTimeHelper.php

示例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++;
     }
 }
開發者ID:ngugijames,項目名稱:ThinkUp,代碼行數:38,代碼來源:TestOfInsightsGeneratorPlugin.php


注:本文中的TimeHelper::setDayOfYear方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。