function TaxonomyLegacyTestCase::testTaxonomyLegacyNode in Drupal 7
Test taxonomy functionality with nodes prior to 1970.
File
- modules/
taxonomy/ taxonomy.test, line 505 - Tests for taxonomy.module.
Class
- TaxonomyLegacyTestCase
- Test for legacy node bug.
Code
function testTaxonomyLegacyNode() {
// Posts an article with a taxonomy term and a date prior to 1970.
$langcode = LANGUAGE_NONE;
$edit = array();
$edit['title'] = $this
->randomName();
$edit['date'] = '1969-01-01 00:00:00 -0500';
$edit["body[{$langcode}][0][value]"] = $this
->randomName();
$edit["field_tags[{$langcode}]"] = $this
->randomName();
$this
->drupalPost('node/add/article', $edit, t('Save'));
// Checks that the node has been saved.
$node = $this
->drupalGetNodeByTitle($edit['title']);
$this
->assertEqual($node->created, strtotime($edit['date']), 'Legacy node was saved with the right date.');
}