MDL-32323 tests: check both deletion with truncate and with delete

This commit is contained in:
Eloy Lafuente (stronk7) 2012-04-12 00:13:38 +02:00
parent 5a798e7eac
commit 7823af0994
2 changed files with 16 additions and 2 deletions

View File

@ -1626,7 +1626,14 @@ class ddl_test extends UnitTestCase {
$record = (object)array('id'=>666, 'course'=>10);
$DB->import_record('testtable', $record);
$DB->delete_records('testtable');
$DB->delete_records('testtable'); // This delete performs one TRUNCATE
$dbman->reset_sequence($table); // using xmldb object
$this->assertEqual(1, $DB->insert_record('testtable', (object)array('course'=>13)));
$record = (object)array('id'=>666, 'course'=>10);
$DB->import_record('testtable', $record);
$DB->delete_records('testtable', array()); // This delete performs one DELETE
$dbman->reset_sequence($table); // using xmldb object
$this->assertEqual(1, $DB->insert_record('testtable', (object)array('course'=>13)));

View File

@ -1600,7 +1600,14 @@ class ddl_testcase extends database_driver_testcase {
$record = (object)array('id'=>666, 'course'=>10);
$DB->import_record('testtable', $record);
$DB->delete_records('testtable');
$DB->delete_records('testtable'); // This delete performs one TRUNCATE
$dbman->reset_sequence($table); // using xmldb object
$this->assertEquals(1, $DB->insert_record('testtable', (object)array('course'=>13)));
$record = (object)array('id'=>666, 'course'=>10);
$DB->import_record('testtable', $record);
$DB->delete_records('testtable', array()); // This delete performs one DELETE
$dbman->reset_sequence($table); // using xmldb object
$this->assertEquals(1, $DB->insert_record('testtable', (object)array('course'=>13)));