Fix merge regressions

This commit is contained in:
Damian Mooyman 2014-04-22 13:28:44 +12:00
parent 982ad569b9
commit 1dcaf36c9b
3 changed files with 12 additions and 9 deletions

View File

@ -42,7 +42,7 @@ class DirectorTest extends SapphireTest {
// TODO Remove director rule, currently API doesnt allow this // TODO Remove director rule, currently API doesnt allow this
// Remove base URL override (setting to false reverts to default behaviour) // Remove base URL override (setting to false reverts to default behaviour)
Director::setBaseURL(false); Config::inst()->update('Director', 'alternate_base_url', false);
// Reinstate the original REQUEST_URI after it was modified by some tests // Reinstate the original REQUEST_URI after it was modified by some tests
$_SERVER['REQUEST_URI'] = self::$originalRequestURI; $_SERVER['REQUEST_URI'] = self::$originalRequestURI;
@ -80,7 +80,7 @@ class DirectorTest extends SapphireTest {
$rootURL = Director::protocolAndHost(); $rootURL = Director::protocolAndHost();
$_SERVER['REQUEST_URI'] = "$rootURL/mysite/sub-page/"; $_SERVER['REQUEST_URI'] = "$rootURL/mysite/sub-page/";
Director::setBaseURL('/mysite/'); Config::inst()->update('Director', 'alternate_base_url', '/mysite/');
// Test already absolute url // Test already absolute url
$this->assertEquals($rootURL, Director::absoluteURL($rootURL)); $this->assertEquals($rootURL, Director::absoluteURL($rootURL));

View File

@ -11,15 +11,14 @@ class ImageTest extends SapphireTest {
protected $origBackend; protected $origBackend;
public function setUp() { public function setUp() {
if(get_class($this) == "ImageTest") if(get_class($this) == "ImageTest") $this->skipTest = true;
$this->skipTest = true;
parent::setUp(); parent::setUp();
$this->origBackend = Image::get_backend();
if($this->skipTest) if($this->skipTest)
return; return;
$this->origBackend = Image::get_backend();
if(!file_exists(ASSETS_PATH)) mkdir(ASSETS_PATH); if(!file_exists(ASSETS_PATH)) mkdir(ASSETS_PATH);
@ -34,7 +33,7 @@ class ImageTest extends SapphireTest {
} }
public function tearDown() { public function tearDown() {
Image::set_backend($this->origBackend); if($this->origBackend) Image::set_backend($this->origBackend);
/* Remove the test files that we've created */ /* Remove the test files that we've created */
$fileIDs = $this->allFixtureIDs('Image'); $fileIDs = $this->allFixtureIDs('Image');

View File

@ -133,7 +133,9 @@ class SecurityTest extends FunctionalTest {
$this->session()->inst_set('SessionForms.MemberLoginForm.Email', 'myuser@silverstripe.com'); $this->session()->inst_set('SessionForms.MemberLoginForm.Email', 'myuser@silverstripe.com');
Security::config()->remember_username = false; Security::config()->remember_username = false;
$this->get(Config::inst()->get('Security', 'login_url')); $this->get(Config::inst()->get('Security', 'login_url'));
$items = $this->cssParser()->getBySelector('#MemberLoginForm_LoginForm #Email input.text'); $items = $this
->cssParser()
->getBySelector('#MemberLoginForm_LoginForm #MemberLoginForm_LoginForm_Email');
$this->assertEquals(1, count($items)); $this->assertEquals(1, count($items));
$this->assertEmpty((string)$items[0]->attributes()->value); $this->assertEmpty((string)$items[0]->attributes()->value);
$this->assertEquals('off', (string)$items[0]->attributes()->autocomplete); $this->assertEquals('off', (string)$items[0]->attributes()->autocomplete);
@ -145,7 +147,9 @@ class SecurityTest extends FunctionalTest {
$this->session()->inst_set('SessionForms.MemberLoginForm.Email', 'myuser@silverstripe.com'); $this->session()->inst_set('SessionForms.MemberLoginForm.Email', 'myuser@silverstripe.com');
Security::config()->remember_username = true; Security::config()->remember_username = true;
$this->get(Config::inst()->get('Security', 'login_url')); $this->get(Config::inst()->get('Security', 'login_url'));
$items = $this->cssParser()->getBySelector('#MemberLoginForm_LoginForm #Email input.text'); $items = $this
->cssParser()
->getBySelector('#MemberLoginForm_LoginForm #MemberLoginForm_LoginForm_Email');
$this->assertEquals(1, count($items)); $this->assertEquals(1, count($items));
$this->assertEquals('myuser@silverstripe.com', (string)$items[0]->attributes()->value); $this->assertEquals('myuser@silverstripe.com', (string)$items[0]->attributes()->value);
$this->assertNotEquals('off', (string)$items[0]->attributes()->autocomplete); $this->assertNotEquals('off', (string)$items[0]->attributes()->autocomplete);