mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
BUGFIX: Clear sitemap registration at the end of each test
This commit is contained in:
parent
d67270fe7a
commit
8d787c486e
@ -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.
|
||||
|
@ -22,6 +22,12 @@ class GoogleSitemapTest extends FunctionalTest {
|
||||
}
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
|
||||
GoogleSitemap::clear_registered_dataobjects();
|
||||
}
|
||||
|
||||
public function testItems() {
|
||||
$sitemap = new GoogleSitemap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user