BUGFIX: Clear sitemap registration at the end of each test

This commit is contained in:
Andrew O'Neil 2012-07-23 15:01:33 +12:00
parent d67270fe7a
commit 8d787c486e
2 changed files with 13 additions and 0 deletions

View File

@ -93,6 +93,13 @@ class GoogleSitemap extends Controller {
return isset(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.

View File

@ -22,6 +22,12 @@ class GoogleSitemapTest extends FunctionalTest {
}
}
public function tearDown() {
parent::tearDown();
GoogleSitemap::clear_registered_dataobjects();
}
public function testItems() {
$sitemap = new GoogleSitemap();