diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-07 05:20:08 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-07 05:20:08 +0000 |
commit | c02fd214b5f339f168e9ced4a1fc38b354a0d119 (patch) | |
tree | 89401642909e568ae65cddfd3efbf933b003919e /modules/taxonomy/taxonomy.test | |
parent | 8fddf2cd48001af736e5951fb7d4e927d56dc4c2 (diff) | |
download | brdo-c02fd214b5f339f168e9ced4a1fc38b354a0d119.tar.gz brdo-c02fd214b5f339f168e9ced4a1fc38b354a0d119.tar.bz2 |
#985292 by ngmaloney, scor, bfroehle: Fixed Nodes published before 1970 won't insert in taxonomy index
Diffstat (limited to 'modules/taxonomy/taxonomy.test')
-rw-r--r-- | modules/taxonomy/taxonomy.test | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index b31f7898b..0664c523a 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -380,6 +380,43 @@ class TaxonomyTermUnitTest extends TaxonomyWebTestCase { } /** + * Test for legacy node bug. + */ +class TaxonomyLegacyTestCase extends TaxonomyWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Test for legacy node bug.', + 'description' => 'Posts an article with a taxonomy term and a date prior to 1970.', + 'group' => 'Taxonomy', + ); + } + + function setUp() { + parent::setUp('taxonomy'); + $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'administer nodes', 'bypass node access')); + $this->drupalLogin($this->admin_user); + } + + /** + * Test taxonomy functionality with nodes prior to 1970. + */ + 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']), t('Legacy node was saved with the right date.')); + } +} + +/** * Tests for taxonomy term functions. */ class TaxonomyTermTestCase extends TaxonomyWebTestCase { |