Permalink
Browse files

Merge pull request #89 from simonwelsh/master

Test fixes
  • Loading branch information...
2 parents 50c9ee8 + 9dac9e5 commit 688e22368d936c9163d5c882e451d3852629ca2c @sminnee sminnee committed Oct 29, 2011
Showing with 4 additions and 4 deletions.
  1. +2 −2 admin/tests/LeftAndMainTest.php
  2. +1 −1 tests/model/DataListTest.php
  3. +1 −1 tests/security/SecurityTest.php
@@ -24,7 +24,7 @@ function setUp() {
public function testSaveTreeNodeSorting() {
$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');
$page1 = $rootPages->offsetGet(0);
$page2 = $rootPages->offsetGet(1);
@@ -197,4 +197,4 @@ class LeftAndMainTest_Object extends DataObject implements TestOnly {
'Hierarchy'
);
-}
+}
@@ -69,7 +69,7 @@ function testLeftJoin() {
}
function testToNestedArray() {
- $list = DataList::create('DataObjectTest_TeamComment');
+ $list = DataList::create('DataObjectTest_TeamComment')->sort('ID');
$nestedArray = $list->toNestedArray();
$expected = array(
0=>
@@ -142,7 +142,7 @@ function testExternalBackUrlRedirectionDisallowed() {
// Test external redirect
$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"
);

0 comments on commit 688e223

Please sign in to comment.