Skip to content

Commit

Permalink
Merge branch 'master' into upstream-master (big-o team branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Jan 7, 2013
2 parents d5f6732 + 8d787c4 commit 90f3c82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/GoogleSitemap.php
Expand Up @@ -102,6 +102,13 @@ public static function unregister_dataobject($className) {
unset(self::$dataobjects[$className]);
}

/**
* Clears registered dataobjects. Useful for unit tests.
*/
public static function clear_registered_dataobjects() {
self::$dataobjects = array();
}

/**
* Returns a list containing each viewable {@link DataObject} instance of
* the registered class names.
Expand Down
6 changes: 6 additions & 0 deletions tests/GoogleSitemapTest.php
Expand Up @@ -27,6 +27,12 @@ public function setUp() {
GoogleSitemap::unregister_dataobject('GoogleSitemapTest_UnviewableDataObject');
}

public function tearDown() {
parent::tearDown();

GoogleSitemap::clear_registered_dataobjects();
}

public function testItems() {
$sitemap = new GoogleSitemap();

Expand Down

0 comments on commit 90f3c82

Please sign in to comment.