Commit 7c1c2adf authored by stefanooldeman's avatar stefanooldeman

separate formatDate tests into individual tests per responsebility

parent e6aa97c7
......@@ -185,29 +185,35 @@ class Solarium_Query_HelperTest extends PHPUnit_Framework_TestCase
);
}
public function testFormatDate()
public function testFormatTimestampInput()
{
//accepts a time
$this->assertNotEquals(
false,
$this->_helper->formatDate(strtotime('2011-10-01')),
'Expects timestamp input to be accpted'
);
}
//accepts a date
public function testFormatDateStringInput()
{
$this->assertNotEquals(
false,
$this->_helper->formatDate(date('Y-m-d', strtotime('2011-10-01'))),
'Expects date string inputs to be accepted'
);
}
//accepts a DateTime object
public function testFormatDateTimeInput()
{
$this->assertNotEquals(
false,
$this->_helper->formatDate(new DateTime(strtotime('2011-10-01'))),
'Expects DateTime object to be accepted'
);
}
public function testFormatDate()
{
//check if timezone is stripped
$expected = strtoupper('Z');
$actual = substr($this->_helper->formatDate(time()), 19, 20);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment