EOHTML
),
array('MassUpdate',<<
EOHTML
),
array('QuickCreate',<<
EOHTML
),
array('DetailView','15'),
);
}
/**
* @dataProvider providerGetDurationMinutesOptions
*/
public function testGetDurationMinutesOptions(
$view,
$returnValue
)
{
$focus = new Call();
$this->assertEquals(
getDurationMinutesOptions($focus,'','',$view),
$returnValue
);
}
public function testGetDurationMinutesOptionsNonDefaultValue()
{
$focus = new Call();
$focus->duration_minutes = '30';
$this->assertEquals(
getDurationMinutesOptions($focus,'','','DetailView'),
$focus->duration_minutes
);
}
public function testGetDurationMinutesOptionsFromRequest()
{
$focus = new Call();
$_REQUEST['duration_minutes'] = '45';
$this->assertEquals(
getDurationMinutesOptions($focus,'','','DetailView'),
$_REQUEST['duration_minutes']
);
unset($_REQUEST['duration_minutes']);
}
public function testGetDurationMinutesOptionsOtherValues()
{
$focus = new Call();
$focus->date_start = null;
$focus->duration_hours = null;
$focus->minutes_value_default = null;
getDurationMinutesOptions($focus,'','','DetailView');
$this->assertEquals($focus->date_start,$GLOBALS['timedate']->to_display_date(gmdate($GLOBALS['timedate']->get_date_time_format())));
$this->assertEquals($focus->duration_hours,'0');
$this->assertEquals($focus->duration_minutes,'1');
}
public function providerGetReminderTime()
{
return array(
array('EditView',<<
EOHTML
),
array('MassUpdate',<<
EOHTML
),
array('SubpanelCreates',<<
EOHTML
),
array('QuickCreate',<<
EOHTML
),
array('DetailView',''),
);
}
/**
* @dataProvider providerGetReminderTime
*/
public function testGetReminderTime($view,$returnValue)
{
$this->markTestSkipped("getReminderTime deprecated as of 6.5.0");
$focus = new Call();
$this->assertEquals( getReminderTime($focus,'','',$view),$returnValue);
}
public function testGetReminderTimeNonDefaultValue()
{
$this->markTestSkipped("getReminderTime deprecated as of 6.5.0");
$focus = new Call();
$focus->reminder_time = '600';
$this->assertEquals(
getReminderTime($focus,'','','EditView'),
<<
EOHTML
);
}
public function testGetReminderTimeNonDefaultValueDetailView()
{
$this->markTestSkipped("getReminderTime deprecated as of 6.5.0");
$focus = new Call();
$focus->reminder_time = '300';
$this->assertEquals( getReminderTime($focus,'','','DetailView'),'5 minutes prior');
}
public function testGetReminderTimeFromRequest()
{
$this->markTestSkipped("getReminderTime deprecated as of 6.5.0");
$focus = new Call();
$_REQUEST['reminder_time'] = '900';
$_REQUEST['full_form'] = true;
$this->assertEquals(
getReminderTime($focus,'','','EditView'),
<<
EOHTML
);
unset($_REQUEST['reminder_time']);
unset($_REQUEST['full_form']);
}
public function testGetReminderTimeFromValue()
{
$this->markTestSkipped("getReminderTime deprecated as of 6.5.0");
$focus = new Call();
unset($focus->reminder_time);
$this->assertEquals(
getReminderTime($focus,'','1800','EditView'),
<<
EOHTML
);
}
}