BUG Force SapphireTest schema reset for extension changes

Previously changes to $requiredExtensions and $illegalExtensions
didn't cause a reset unless there was also other schema-altering
settings like $extensionsToRemove or $extraDataObjects
This commit is contained in:
Ingo Schommer 2012-11-23 11:12:03 +01:00
parent 96acd50681
commit a3cd7ddc09

View File

@ -272,6 +272,8 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
* for tearing down the state again.
*/
public function setUpOnce() {
$isAltered = false;
// Remove any illegal extensions that are present
foreach($this->illegalExtensions as $class => $extensions) {
foreach($extensions as $extension) {
@ -298,7 +300,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
}
// If we have made changes to the extensions present, then migrate the database schema.
if($this->extensionsToReapply || $this->extensionsToRemove || $this->extraDataObjects) {
if($isAltered || $this->extensionsToReapply || $this->extensionsToRemove || $this->extraDataObjects) {
if(!self::using_temp_db()) self::create_temp_db();
$this->resetDBSchema(true);
}