Skip to content

Commit

Permalink
Merge pull request #229 from halkyon/master
Browse files Browse the repository at this point in the history
Renamed test GridFieldToolbarHeaderTest classes (sorry for so many commits!)
  • Loading branch information
sminnee committed Mar 9, 2012
2 parents 0c93d31 + 033a1e5 commit 193288a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/forms/gridfield/GridFieldToolbarHeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class GridFieldToolbarHeaderTest extends SapphireTest {
static $fixture_file = 'GridFieldToolbarHeaderTest.yml';

protected $extraDataObjects = array(
'GridFieldDetailFormTest_Company',
'GridFieldToolbarHeaderTest_Company',
);

public function testGridTitleAddNewEnabled() {
Expand All @@ -13,7 +13,7 @@ public function testGridTitleAddNewEnabled() {
$config = new GridFieldConfig();
$config->addComponent($titleField = new GridFieldToolbarHeader());
$actions = new FieldList();
$grid = new GridField('TestField', 'Test Field', new DataList('GridFieldDetailFormTest_Company'),$config);
$grid = new GridField('TestField', 'Test Field', new DataList('GridFieldToolbarHeaderTest_Company'),$config);
$fields = new FieldList($rootTab = new TabSet("Root",$tabMain = new Tab('Main',$grid)));
$form = new Form(Controller::curr(), "TestForm", $fields, $actions);

Expand All @@ -28,7 +28,7 @@ public function testGridTitleAddNewDisabled() {
$config = new GridFieldConfig();
$config->addComponent($titleField = new GridFieldToolbarHeader());
$actions = new FieldList();
$grid = new GridField('TestField', 'Test Field', new DataList('GridFieldDetailFormTest_Company'),$config);
$grid = new GridField('TestField', 'Test Field', new DataList('GridFieldToolbarHeaderTest_Company'),$config);
$fields = new FieldList($rootTab = new TabSet("Root",$tabMain = new Tab('Main',$grid)));
$form = new Form(Controller::curr(), "TestForm", $fields, $actions);

Expand All @@ -41,15 +41,15 @@ public function testGridTitleAddNewWithoutPermission() {
if(Member::currentUser()) { Member::currentUser()->logOut(); }
$config = new GridFieldConfig();
$config->addComponent($titleField = new GridFieldToolbarHeader());
$grid = new GridField('TestField', 'Test Field', new DataList('GridFieldDetailFormTest_Company'),$config);
$grid = new GridField('TestField', 'Test Field', new DataList('GridFieldToolbarHeaderTest_Company'),$config);
$fields = new FieldList(new TabSet("Root",$tabMain = new Tab('Main',$grid)));
$form = new Form(Controller::curr(), "TestForm", $fields, new FieldList());

$html = $form->forTemplate();
$this->assertNotContains('data-icon="add"', $html, "HTML should not contain the 'add new' button");
}
}
class GridFieldDetailFormTest_Company extends DataObject implements TestOnly {
class GridFieldToolbarHeaderTest_Company extends DataObject implements TestOnly {

public static $db = array(
'Name' => 'Varchar(100)'
Expand Down
2 changes: 1 addition & 1 deletion tests/forms/gridfield/GridFieldToolbarHeaderTest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GridFieldDetailFormTest_Company:
GridFieldToolbarHeaderTest_Company:
test-company-1:
Name: Test company 1
test-company-2:
Expand Down

0 comments on commit 193288a

Please sign in to comment.