[ticket/251] Fix display of date of users upcoming birthdays
B3P-251
This commit is contained in:
@@ -194,7 +194,7 @@ class birthday_list extends module_base
|
|||||||
*/
|
*/
|
||||||
protected function format_birthday($user, $birthday, $date_settings)
|
protected function format_birthday($user, $birthday, $date_settings)
|
||||||
{
|
{
|
||||||
if (!preg_match('/(?:[0-9])+-+(?:[0-9]{2})+-+(?:[0-9]{4})/', $birthday, $match))
|
if (!preg_match('/[0-9]{1,2}-[ ]?[0-9]{1,2}-[0-9]{4}/', $birthday))
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
<span style="float:left;">
|
<span style="float:left;">
|
||||||
<img src="{T_EXT_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" />
|
<img src="{T_EXT_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" />
|
||||||
</span>
|
</span>
|
||||||
<span style="float:left; padding-left:5px; padding-top:2px;">
|
<span style="float:left; padding-left: 5px; padding-top: 3px;">
|
||||||
<span title="{board3_birthday_ahead_list.DATE}">{board3_birthday_ahead_list.USER}</span>
|
<span title="{board3_birthday_ahead_list.DATE}">{board3_birthday_ahead_list.USER}</span>
|
||||||
</span>
|
</span>
|
||||||
<span style="float: right;">
|
<span style="float: right; padding-top:3px;">
|
||||||
<!-- IF board3_birthday_ahead_list.AGE -->{board3_birthday_ahead_list.AGE}<!-- ENDIF -->
|
<!-- IF board3_birthday_ahead_list.AGE -->{board3_birthday_ahead_list.AGE}<!-- ENDIF -->
|
||||||
</span><br style="clear: both" />
|
</span><br style="clear: both" />
|
||||||
<!-- END board3_birthday_ahead_list -->
|
<!-- END board3_birthday_ahead_list -->
|
||||||
|
|||||||
50
tests/functional/portal_birthday_list_test.php
Normal file
50
tests/functional/portal_birthday_list_test.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package testing
|
||||||
|
* @copyright (c) 2014 Board3 Group
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group functional
|
||||||
|
*/
|
||||||
|
class phpbb_functional_portal_birthday_list_test extends \board3\portal\tests\testframework\functional_test_case
|
||||||
|
{
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
$this->login();
|
||||||
|
$this->admin_login();
|
||||||
|
$this->enable_board3_portal_ext();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_setup_birthday()
|
||||||
|
{
|
||||||
|
$this->logout();
|
||||||
|
$uid = $this->create_user('portal_birthday_user');
|
||||||
|
if (!$uid)
|
||||||
|
{
|
||||||
|
$this->markIncomplete('Unable to create portal_user');
|
||||||
|
}
|
||||||
|
$this->login('portal_birthday_user');
|
||||||
|
$crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=profile_info&sid=' . $this->sid);
|
||||||
|
$form = $crawler->selectButton('Submit')->form();
|
||||||
|
$form->setValues(array(
|
||||||
|
'bday_day' => date('d', time() + 86400*2),
|
||||||
|
'bday_month' => date('m', time() + 86400*2),
|
||||||
|
'bday_year' => date('Y', time() + 86400*2),
|
||||||
|
));
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @depends test_setup_birthday
|
||||||
|
*/
|
||||||
|
public function test_after_announce()
|
||||||
|
{
|
||||||
|
$crawler = self::request('GET', 'app.php/portal');
|
||||||
|
$this->assertContains(date('d M', time() + 86400*2), $crawler->html());
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user