mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Removing deprecated tests
This commit is contained in:
parent
0d79897d4f
commit
d038cd7a65
@ -191,40 +191,6 @@ class DirectorTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testURLParam() {
|
|
||||||
// 2.4 only
|
|
||||||
$originalDeprecation = Deprecation::dump_settings();
|
|
||||||
Deprecation::notification_version('2.4');
|
|
||||||
|
|
||||||
Director::test('DirectorTestRule/myaction/myid/myotherid');
|
|
||||||
// TODO Works on the assumption that urlParam() is not unset after a test run, which is dodgy
|
|
||||||
$this->assertEquals(Director::urlParam('Action'), 'myaction');
|
|
||||||
$this->assertEquals(Director::urlParam('ID'), 'myid');
|
|
||||||
$this->assertEquals(Director::urlParam('OtherID'), 'myotherid');
|
|
||||||
|
|
||||||
Deprecation::restore_settings($originalDeprecation);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testURLParams() {
|
|
||||||
// 2.4 only
|
|
||||||
$originalDeprecation = Deprecation::dump_settings();
|
|
||||||
Deprecation::notification_version('2.4');
|
|
||||||
|
|
||||||
Director::test('DirectorTestRule/myaction/myid/myotherid');
|
|
||||||
// TODO Works on the assumption that urlParam() is not unset after a test run, which is dodgy
|
|
||||||
$this->assertEquals(
|
|
||||||
Director::urlParams(),
|
|
||||||
array(
|
|
||||||
'Controller' => 'DirectorTestRequest_Controller',
|
|
||||||
'Action' => 'myaction',
|
|
||||||
'ID' => 'myid',
|
|
||||||
'OtherID' => 'myotherid'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Deprecation::restore_settings($originalDeprecation);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that additional parameters specified in the routing table are
|
* Tests that additional parameters specified in the routing table are
|
||||||
* saved in the request
|
* saved in the request
|
||||||
|
@ -116,24 +116,6 @@ class DataObjectTest extends SapphireTest {
|
|||||||
$this->assertEquals(3, $comments->Count());
|
$this->assertEquals(3, $comments->Count());
|
||||||
$this->assertEquals('Phil', $comments->First()->Name);
|
$this->assertEquals('Phil', $comments->First()->Name);
|
||||||
|
|
||||||
// Test join - 2.4 only
|
|
||||||
$originalDeprecation = Deprecation::dump_settings();
|
|
||||||
Deprecation::notification_version('2.4');
|
|
||||||
|
|
||||||
$comments = DataObject::get(
|
|
||||||
'DataObjectTest_TeamComment',
|
|
||||||
"\"DataObjectTest_Team\".\"Title\" = 'Team 1'",
|
|
||||||
"\"Name\" ASC",
|
|
||||||
"INNER JOIN \"DataObjectTest_Team\""
|
|
||||||
. " ON \"DataObjectTest_TeamComment\".\"TeamID\" = \"DataObjectTest_Team\".\"ID\""
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->assertEquals(2, $comments->Count());
|
|
||||||
$this->assertEquals('Bob', $comments->First()->Name);
|
|
||||||
$this->assertEquals('Joe', $comments->Last()->Name);
|
|
||||||
|
|
||||||
Deprecation::restore_settings($originalDeprecation);
|
|
||||||
|
|
||||||
// Test limit
|
// Test limit
|
||||||
$comments = DataObject::get('DataObjectTest_TeamComment', '', "\"Name\" ASC", '', '1,2');
|
$comments = DataObject::get('DataObjectTest_TeamComment', '', "\"Name\" ASC", '', '1,2');
|
||||||
$this->assertEquals(2, $comments->Count());
|
$this->assertEquals(2, $comments->Count());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user