Fixing unit test to restore extensions after test

This commit is contained in:
Sean Harvey 2012-09-10 14:09:40 +12:00
parent 5cbd2dbeb4
commit e73d28b24e

View File

@ -47,6 +47,7 @@ class CMSProfileControllerTest extends FunctionalTest {
}
public function testExtendedPermissionsStopEditingOwnProfile() {
$existingExtensions = Config::inst()->get('Member', 'extensions');
Config::inst()->update('Member', 'extensions', array('CMSProfileControllerTestExtension'));
$member = $this->objFromFixture('Member', 'user1');
@ -66,6 +67,9 @@ class CMSProfileControllerTest extends FunctionalTest {
$member = $this->objFromFixture('Member', 'user1');
$this->assertNotEquals($member->FirstName, 'JoeEdited', 'FirstName field was NOT changed because we modified canEdit');
Config::inst()->remove('Member', 'extensions');
Config::inst()->update('Member', 'extensions', $existingExtensions);
}
}