1 taxonomy.test | TaxonomyLegacyTestCase::testTaxonomyLegacyNode() |
Test taxonomy functionality with nodes prior to 1970.
File
- core/
modules/ taxonomy/ tests/ taxonomy.test, line 526 - Tests for taxonomy.module.
Class
- TaxonomyLegacyTestCase
- Test for legacy node bug.
Code
function testTaxonomyLegacyNode() {
// Posts a post with a taxonomy term and a date prior to 1970.
$langcode = LANGUAGE_NONE;
$edit = array();
$edit['title'] = $this->randomName();
$edit['date[date]'] = '1969-01-01';
$edit['date[time]'] = '00:00:00';
$edit["body[$langcode][0][value]"] = $this->randomName();
$edit["field_tags[$langcode]"] = $this->randomName();
$this->backdropPost('node/add/post', $edit, t('Save'));
// Checks that the node has been saved.
$node = $this->backdropGetNodeByTitle($edit['title']);
$date = new BackdropDateTime('1969-01-01 00:00:00', $this->admin_user->timezone);
$this->assertEqual($node->created, $date->format('U'), 'Legacy node was saved with the right date.');
}