Merge pull request #89 from simonwelsh/master

Test fixes
This commit is contained in:
Sam Minnée 2011-10-28 19:42:50 -07:00
commit 688e22368d
3 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ class LeftAndMainTest extends FunctionalTest {
public function testSaveTreeNodeSorting() { public function testSaveTreeNodeSorting() {
$this->loginWithPermission('ADMIN'); $this->loginWithPermission('ADMIN');
$rootPages = DataObject::get('LeftAndMainTest_Object', '"ParentID" = 0'); // implicitly sorted $rootPages = DataObject::get('LeftAndMainTest_Object', '"ParentID" = 0', '"ID"'); // forcing sorting for non-MySQL
$siblingIDs = $rootPages->column('ID'); $siblingIDs = $rootPages->column('ID');
$page1 = $rootPages->offsetGet(0); $page1 = $rootPages->offsetGet(0);
$page2 = $rootPages->offsetGet(1); $page2 = $rootPages->offsetGet(1);

View File

@ -69,7 +69,7 @@ class DataListTest extends SapphireTest {
} }
function testToNestedArray() { function testToNestedArray() {
$list = DataList::create('DataObjectTest_TeamComment'); $list = DataList::create('DataObjectTest_TeamComment')->sort('ID');
$nestedArray = $list->toNestedArray(); $nestedArray = $list->toNestedArray();
$expected = array( $expected = array(
0=> 0=>

View File

@ -142,7 +142,7 @@ class SecurityTest extends FunctionalTest {
// Test external redirect // Test external redirect
$response = $this->doTestLoginForm('noexpiry@silverstripe.com', '1nitialPassword', 'http://myspoofedhost.com'); $response = $this->doTestLoginForm('noexpiry@silverstripe.com', '1nitialPassword', 'http://myspoofedhost.com');
$this->assertNotRegExp('/^' . preg_quote('http://myspoofedhost.com', '/') . '/', $response->getHeader('Location'), $this->assertNotRegExp('/^' . preg_quote('http://myspoofedhost.com', '/') . '/', (string)$response->getHeader('Location'),
"Redirection to external links in login form BackURL gets prevented as a measure against spoofing attacks" "Redirection to external links in login form BackURL gets prevented as a measure against spoofing attacks"
); );