Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
53ef28ec
Commit
53ef28ec
authored
Mar 08, 2009
by
webchick
Browse files
#350545
by Damien Tournoud: Remove unreliable invalid date test so that SQLite tests pass.
parent
577c14e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/simpletest/tests/database_test.test
View file @
53ef28ec
...
...
@@ -2185,8 +2185,8 @@ class DatabaseAnsiSyntaxTestCase extends DatabaseTestCase {
class
DatabaseInvalidDataTestCase
extends
DatabaseTestCase
{
function
getInfo
()
{
return
array
(
'name'
=>
t
(
'
SQL handling tests
'
),
'description'
=>
t
(
'Test handling of invalid data.'
),
'name'
=>
t
(
'
Invalid data
'
),
'description'
=>
t
(
'Test handling of
some
invalid data.'
),
'group'
=>
t
(
'Database'
),
);
}
...
...
@@ -2250,49 +2250,6 @@ class DatabaseInvalidDataTestCase extends DatabaseTestCase {
}
}
/**
* Dates do not allow zero values for month/day or a zero value for an entire date.
*/
function
testInvalidDate
()
{
// Test zero in month.
try
{
db_insert
(
'test_date'
)
->
fields
(
array
(
'dummy_date'
=>
'2008-00-01 12:00:00'
))
->
execute
();
$this
->
assertTrue
(
FALSE
,
t
(
'Insert with zero as month in date unexpectedly succeeded.'
));
}
catch
(
Exception
$e
)
{
$this
->
assertTrue
(
TRUE
,
t
(
'Insert with zero as month in date causes expected SQL error.'
));
}
// Test zero in day.
try
{
db_insert
(
'test_date'
)
->
fields
(
array
(
'dummy_date'
=>
'2008-05-00 12:00:00'
))
->
execute
();
$this
->
assertTrue
(
FALSE
,
t
(
'Insert with zero as day in date unexpectedly succeeded.'
));
}
catch
(
Exception
$e
)
{
$this
->
assertTrue
(
TRUE
,
t
(
'Insert with zero as day in date causes expected SQL error.'
));
}
// Test 0000-00-00 00:00:00 is invalid.
try
{
db_insert
(
'test_date'
)
->
fields
(
array
(
'dummy_date'
=>
'0000-00-00 00:00:00'
))
->
execute
();
$this
->
assertTrue
(
FALSE
,
t
(
'Insertion of zero date unexpectedly succeeded.'
));
}
catch
(
Exception
$e
)
{
$this
->
assertTrue
(
TRUE
,
t
(
'Insertion of zero date failed as expected.'
));
}
}
}
/**
...
...
Write
Preview
Supports
Markdown
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