Test tidy up

This commit is contained in:
Daniel Hensby 2016-07-21 12:55:03 +01:00
parent ef51d59b49
commit 52abae49ca
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
2 changed files with 16 additions and 6 deletions

View File

@ -41,7 +41,7 @@ class GridFieldAddNewMultiClassTest extends SapphireTest {
* @ignore * @ignore
*/ */
class GridFieldAddNewMultiClassTest_A { class GridFieldAddNewMultiClassTest_A implements TestOnly {
public function i18n_singular_name() { public function i18n_singular_name() {
$class = get_class($this); $class = get_class($this);
return substr($class, strpos($class, '_') + 1); return substr($class, strpos($class, '_') + 1);
@ -52,7 +52,7 @@ class GridFieldAddNewMultiClassTest_A {
} }
} }
class GridFieldAddNewMultiClassTest_B extends GridFieldAddNewMultiClassTest_A {} class GridFieldAddNewMultiClassTest_B extends GridFieldAddNewMultiClassTest_A implements TestOnly {}
class GridFieldAddNewMultiClassTest_C extends GridFieldAddNewMultiClassTest_A {} class GridFieldAddNewMultiClassTest_C extends GridFieldAddNewMultiClassTest_A implements TestOnly {}
/**#@-*/ /**#@-*/

View File

@ -6,6 +6,12 @@ class GridFieldOrderableRowsTest extends SapphireTest {
protected $usesDatabase = true; protected $usesDatabase = true;
protected $extraDataObjects = array(
'GridFieldOrderableRowsTest_Parent',
'GridFieldOrderableRowsTest_Ordered',
'GridFieldOrderableRowsTest_Subclass',
);
/** /**
* @covers GridFieldOrderableRows::getSortTable * @covers GridFieldOrderableRows::getSortTable
*/ */
@ -42,7 +48,7 @@ class GridFieldOrderableRowsTest extends SapphireTest {
* @ignore * @ignore
*/ */
class GridFieldOrderableRowsTest_Parent extends DataObject { class GridFieldOrderableRowsTest_Parent extends DataObject implements TestOnly {
private static $has_many = array( private static $has_many = array(
'MyHasMany' => 'GridFieldOrderableRowsTest_Ordered', 'MyHasMany' => 'GridFieldOrderableRowsTest_Ordered',
@ -59,7 +65,7 @@ class GridFieldOrderableRowsTest_Parent extends DataObject {
} }
class GridFieldOrderableRowsTest_Ordered extends DataObject { class GridFieldOrderableRowsTest_Ordered extends DataObject implements TestOnly {
private static $db = array( private static $db = array(
'Sort' => 'Int' 'Sort' => 'Int'
@ -69,9 +75,13 @@ class GridFieldOrderableRowsTest_Ordered extends DataObject {
'Parent' => 'GridFieldOrderableRowsTest_Parent' 'Parent' => 'GridFieldOrderableRowsTest_Parent'
); );
private static $belongs_many_many =array(
'MyManyMany' => 'GridFieldOrderableRowsTest_Parent',
);
} }
class GridFieldOrderableRowsTest_Subclass extends GridFieldOrderableRowsTest_Ordered { class GridFieldOrderableRowsTest_Subclass extends GridFieldOrderableRowsTest_Ordered implements TestOnly {
} }
/**#@-*/ /**#@-*/