Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
7c1c2adf
Commit
7c1c2adf
authored
Jan 13, 2012
by
stefanooldeman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
separate formatDate tests into individual tests per responsebility
parent
e6aa97c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
tests/Solarium/Query/HelperTest.php
tests/Solarium/Query/HelperTest.php
+10
-4
No files found.
tests/Solarium/Query/HelperTest.php
View file @
7c1c2adf
...
...
@@ -185,29 +185,35 @@ class Solarium_Query_HelperTest extends PHPUnit_Framework_TestCase
);
}
public
function
testFormat
Date
()
public
function
testFormat
TimestampInput
()
{
//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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment