Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
8ebd4449
Commit
8ebd4449
authored
Jan 13, 2010
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DDC-179 - One more test for possible summer-time crazyness
parent
83b247b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
DateTest.php
tests/Doctrine/Tests/DBAL/Types/DateTest.php
+21
-1
No files found.
tests/Doctrine/Tests/DBAL/Types/DateTest.php
View file @
8ebd4449
...
...
@@ -11,12 +11,19 @@ class DateTest extends \Doctrine\Tests\DbalTestCase
{
protected
$_platform
,
$_type
;
$_type
,
$_tz
;
protected
function
setUp
()
{
$this
->
_platform
=
new
\Doctrine\Tests\DBAL\Mocks\MockPlatform
();
$this
->
_type
=
Type
::
getType
(
'date'
);
$this
->
_tz
=
date_default_timezone_get
();
}
public
function
tearDown
()
{
date_default_timezone_set
(
$this
->
_tz
);
}
public
function
testDateConvertsToDatabaseValue
()
...
...
@@ -41,4 +48,17 @@ class DateTest extends \Doctrine\Tests\DbalTestCase
$this
->
assertEquals
(
'00:00:00'
,
$date
->
format
(
'H:i:s'
));
}
public
function
testDateRests_SummerTimeAffection
()
{
date_default_timezone_set
(
'Europe/Berlin'
);
$date
=
$this
->
_type
->
convertToPHPValue
(
'2009-08-01'
,
$this
->
_platform
);
$this
->
assertEquals
(
'00:00:00'
,
$date
->
format
(
'H:i:s'
));
$this
->
assertEquals
(
'2009-08-01'
,
$date
->
format
(
'Y-m-d'
));
$date
=
$this
->
_type
->
convertToPHPValue
(
'2009-11-01'
,
$this
->
_platform
);
$this
->
assertEquals
(
'00:00:00'
,
$date
->
format
(
'H:i:s'
));
$this
->
assertEquals
(
'2009-11-01'
,
$date
->
format
(
'Y-m-d'
));
}
}
\ No newline at end of file
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