mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
3.1 compat
This commit is contained in:
parent
7e098b2863
commit
e15366359e
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
class BasicFieldsTestPage extends TestPage {
|
||||
static $db = array(
|
||||
private static $db = array(
|
||||
'Checkbox' => 'Boolean',
|
||||
'Readonly' => 'Varchar',
|
||||
'Textarea' => 'Text',
|
||||
@ -33,7 +33,7 @@ class BasicFieldsTestPage extends TestPage {
|
||||
'OptionSet' => 'Int',
|
||||
);
|
||||
|
||||
static $has_one = array(
|
||||
private static $has_one = array(
|
||||
'Dropdown' => 'TestCategory',
|
||||
'GroupedDropdown' => 'TestCategory',
|
||||
'ListboxField' => 'TestCategory',
|
||||
@ -42,11 +42,11 @@ class BasicFieldsTestPage extends TestPage {
|
||||
'Image' => 'Image',
|
||||
);
|
||||
|
||||
static $has_many = array(
|
||||
private static $has_many = array(
|
||||
'HasManyFiles' => 'File',
|
||||
);
|
||||
|
||||
static $many_many = array(
|
||||
private static $many_many = array(
|
||||
'ManyManyFiles' => 'File',
|
||||
'MultipleListboxField' => 'TestCategory',
|
||||
);
|
||||
|
@ -6,27 +6,27 @@ class Company extends DataObject {
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $db = array(
|
||||
private static $db = array(
|
||||
'Name'=>'Varchar(255)',
|
||||
'Category'=>'Varchar(255)',
|
||||
'Revenue'=>'Float',
|
||||
'CEO'=>'Varchar(255)',
|
||||
);
|
||||
|
||||
public static $has_one = array(
|
||||
private static $has_one = array(
|
||||
'RelationFieldsTestPage' => 'RelationFieldsTestPage',
|
||||
'GridFieldTestPageHasOne' => 'GridFieldTestPage'
|
||||
);
|
||||
|
||||
public static $has_many = array(
|
||||
private static $has_many = array(
|
||||
'Employees' => 'Employee'
|
||||
);
|
||||
|
||||
public static $many_many = array(
|
||||
private static $many_many = array(
|
||||
'PastEmployees' => 'Employee'
|
||||
);
|
||||
|
||||
public static $many_many_extraFields = array(
|
||||
private static $many_many_extraFields = array(
|
||||
'PastEmployees' => array(
|
||||
'YearStart' => 'Int',
|
||||
'YearEnd' => 'Int',
|
||||
@ -34,12 +34,12 @@ class Company extends DataObject {
|
||||
)
|
||||
);
|
||||
|
||||
static $belongs_many_many = array(
|
||||
private static $belongs_many_many = array(
|
||||
'RelationFieldsTestPages' => 'RelationFieldsTestPage',
|
||||
'GridFieldTestPage' => 'GridFieldTestPage'
|
||||
);
|
||||
|
||||
public static $summary_fields = array(
|
||||
private static $summary_fields = array(
|
||||
'Name',
|
||||
'Category',
|
||||
'Revenue',
|
||||
@ -47,7 +47,7 @@ class Company extends DataObject {
|
||||
'DynamicProperty'
|
||||
);
|
||||
|
||||
public static $searchable_fields = array(
|
||||
private static $searchable_fields = array(
|
||||
'Name',
|
||||
'Category',
|
||||
'Revenue',
|
||||
|
@ -6,17 +6,17 @@
|
||||
*/
|
||||
class Employee extends DataObject {
|
||||
|
||||
public static $db = array(
|
||||
private static $db = array(
|
||||
'Name' => 'Varchar',
|
||||
'Biography' => 'HTMLText'
|
||||
);
|
||||
|
||||
public static $has_one = array(
|
||||
private static $has_one = array(
|
||||
'Company' => 'Company',
|
||||
'ProfileImage' => 'Image'
|
||||
);
|
||||
|
||||
public static $belongs_many_many = array(
|
||||
private static $belongs_many_many = array(
|
||||
'PastCompanies' => 'Company'
|
||||
);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
class FileUploadRole extends DataExtension{
|
||||
static $has_one = array(
|
||||
private static $has_one = array(
|
||||
'AFile' => 'File',
|
||||
'AImage' => 'Image',
|
||||
);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
class FrameworkTestRole extends DataExtension {
|
||||
|
||||
static $has_one = array(
|
||||
private static $has_one = array(
|
||||
'FavouritePage' => 'SiteTree',
|
||||
);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
class FrameworkTestSiteTreeExtension extends DataExtension {
|
||||
|
||||
static $has_one = array('RelationFieldsTestPage' => 'RelationFieldsTestPage');
|
||||
static $belongs_many_many = array('RelationFieldsTestPages' => 'RelationFieldsTestPage');
|
||||
private static $has_one = array('RelationFieldsTestPage' => 'RelationFieldsTestPage');
|
||||
private static $belongs_many_many = array('RelationFieldsTestPages' => 'RelationFieldsTestPage');
|
||||
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
<?php
|
||||
class GridFieldTestPage extends TestPage {
|
||||
|
||||
static $has_one = array(
|
||||
private static $has_one = array(
|
||||
"HasOneCompany" => "Company",
|
||||
);
|
||||
|
||||
static $has_many = array(
|
||||
private static $has_many = array(
|
||||
"HasManyCompanies" => "Company",
|
||||
);
|
||||
|
||||
static $many_many = array(
|
||||
private static $many_many = array(
|
||||
"ManyManyCompanies" => "Company",
|
||||
);
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
class Organisation extends DataObject {
|
||||
|
||||
// Used to test the Multiform module
|
||||
static $db = array(
|
||||
private static $db = array(
|
||||
'OrganisationName' => 'Text'
|
||||
);
|
||||
|
||||
|
@ -2,20 +2,20 @@
|
||||
|
||||
class RelationFieldsTestPage extends TestPage {
|
||||
|
||||
static $has_one = array(
|
||||
private static $has_one = array(
|
||||
"HasOneCompany" => "Company",
|
||||
"HasOnePage" => "SiteTree",
|
||||
);
|
||||
static $has_many = array(
|
||||
private static $has_many = array(
|
||||
"HasManyCompanies" => "Company",
|
||||
"HasManyPages" => "SiteTree",
|
||||
);
|
||||
static $many_many = array(
|
||||
private static $many_many = array(
|
||||
"ManyManyCompanies" => "Company",
|
||||
"ManyManyPages" => "SiteTree",
|
||||
);
|
||||
|
||||
static $defaults = array(
|
||||
private static $defaults = array(
|
||||
'Title' => 'Relational Fields'
|
||||
);
|
||||
|
||||
|
@ -4,10 +4,10 @@
|
||||
* A data type that is related many-many to RelationFieldsTestPage, for testing purposes
|
||||
*/
|
||||
class TestCategory extends DataObject {
|
||||
static $db = array(
|
||||
private static $db = array(
|
||||
"Title" => "Varchar",
|
||||
);
|
||||
static $belongs_many_many = array(
|
||||
private static $belongs_many_many = array(
|
||||
"RelationPages" => "RelationFieldsTestPage",
|
||||
);
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
class TestModelAdmin extends ModelAdmin {
|
||||
static $url_segment = 'test';
|
||||
static $menu_title = 'Test ModelAdmin';
|
||||
private static $url_segment = 'test';
|
||||
private static $menu_title = 'Test ModelAdmin';
|
||||
|
||||
static $managed_models = array(
|
||||
private static $managed_models = array(
|
||||
"Company",
|
||||
"Employee",
|
||||
);
|
||||
|
@ -2,12 +2,6 @@
|
||||
|
||||
class Page2MultiFormTestPage extends Page {
|
||||
|
||||
static $db = array(
|
||||
);
|
||||
|
||||
static $has_one = array(
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
class Page2MultiFormTestPage_Controller extends Page_Controller {
|
||||
|
@ -2,12 +2,6 @@
|
||||
|
||||
class Page3MultiFormTestPage extends Page {
|
||||
|
||||
static $db = array(
|
||||
);
|
||||
|
||||
static $has_one = array(
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
class Page3MultiFormTestPage_Controller extends Page_Controller {
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
class TestTag extends DataObject {
|
||||
|
||||
static $db = array(
|
||||
private static $db = array(
|
||||
'Title' => 'Text'
|
||||
);
|
||||
|
||||
static $belongs_many_many = array(
|
||||
private static $belongs_many_many = array(
|
||||
'Pages' => 'TestTagFieldPage'
|
||||
);
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
class TestTagFieldPage extends Page {
|
||||
|
||||
static $db = array(
|
||||
private static $db = array(
|
||||
'TestTagString' => 'Text',
|
||||
'FixedTags' => 'Text'
|
||||
);
|
||||
|
||||
static $many_many = array(
|
||||
private static $many_many = array(
|
||||
'TestTags' => 'TestTag',
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user