Commit 53ef28ec authored by webchick's avatar webchick
Browse files

#350545 by Damien Tournoud: Remove unreliable invalid date test so that SQLite tests pass.

parent 577c14e8
......@@ -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.'));
}
}
}
/**
......
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