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
// 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
$_SERVER['REQUEST_URI'] = self::$originalRequestURI;
@ -80,7 +80,7 @@ class DirectorTest extends SapphireTest {
$rootURL = Director::protocolAndHost();
$_SERVER['REQUEST_URI'] = "$rootURL/mysite/sub-page/";
Director::setBaseURL('/mysite/');
Config::inst()->update('Director', 'alternate_base_url', '/mysite/');
// Test already absolute url
$this->assertEquals($rootURL, Director::absoluteURL($rootURL));

View File

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

View File

@ -133,7 +133,9 @@ class SecurityTest extends FunctionalTest {
$this->session()->inst_set('SessionForms.MemberLoginForm.Email', 'myuser@silverstripe.com');
Security::config()->remember_username = false;
$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->assertEmpty((string)$items[0]->attributes()->value);
$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');
Security::config()->remember_username = true;
$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('myuser@silverstripe.com', (string)$items[0]->attributes()->value);
$this->assertNotEquals('off', (string)$items[0]->attributes()->autocomplete);