MINOR FIX: columns quoted properly

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86504 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2009-09-17 00:03:22 +00:00
parent b1ab0a5bc0
commit e1763ab4f2

View File

@ -31,7 +31,7 @@ class ComplexTableFieldTest extends FunctionalTest {
} }
function testAddingManyManyNewPlayer() { function testAddingManyManyNewPlayer() {
$team = DataObject::get_one('ComplexTableFieldTest_Team', "Name = 'The Awesome People'"); $team = DataObject::get_one('ComplexTableFieldTest_Team', "\"Name\" = 'The Awesome People'");
$this->post('ComplexTableFieldTest_Controller/ManyManyForm/field/Players/AddForm', array( $this->post('ComplexTableFieldTest_Controller/ManyManyForm/field/Players/AddForm', array(
'Name' => 'Bobby Joe', 'Name' => 'Bobby Joe',
@ -43,14 +43,14 @@ class ComplexTableFieldTest extends FunctionalTest {
) )
)); ));
$newPlayer = DataObject::get_one('ComplexTableFieldTest_Player', "Name = 'Bobby Joe'"); $newPlayer = DataObject::get_one('ComplexTableFieldTest_Player', "\"Name\" = 'Bobby Joe'");
$this->assertNotNull($newPlayer, 'A new ComplexTableFieldTest_Player record was created, Name = "Bobby Joe"'); $this->assertNotNull($newPlayer, 'A new ComplexTableFieldTest_Player record was created, Name = "Bobby Joe"');
$teams = $newPlayer->getManyManyComponents('Teams'); $teams = $newPlayer->getManyManyComponents('Teams');
$this->assertEquals($teams->Count(), 1, 'Automatic many-many relation was set correctly on the new player'); $this->assertEquals($teams->Count(), 1, 'Automatic many-many relation was set correctly on the new player');
} }
function testAddingHasManyData() { function testAddingHasManyData() {
$team = DataObject::get_one('ComplexTableFieldTest_Team', "Name = 'The Awesome People'"); $team = DataObject::get_one('ComplexTableFieldTest_Team', "\"Name\" = 'The Awesome People'");
$this->post('ComplexTableFieldTest_Controller/HasManyForm/field/Sponsors/AddForm', array( $this->post('ComplexTableFieldTest_Controller/HasManyForm/field/Sponsors/AddForm', array(
'Name' => 'Jim Beam', 'Name' => 'Jim Beam',
@ -62,7 +62,7 @@ class ComplexTableFieldTest extends FunctionalTest {
) )
)); ));
$newSponsor = DataObject::get_one('ComplexTableFieldTest_Sponsor', "Name = 'Jim Beam'"); $newSponsor = DataObject::get_one('ComplexTableFieldTest_Sponsor', "\"Name\" = 'Jim Beam'");
$this->assertNotNull($newSponsor, 'A new ComplexTableFieldTest_Sponsor record was created, Name = "Jim Beam"'); $this->assertNotNull($newSponsor, 'A new ComplexTableFieldTest_Sponsor record was created, Name = "Jim Beam"');
$this->assertEquals($newSponsor->TeamID, $team->ID, 'Automatic has-many/has-one relation was set correctly on the sponsor'); $this->assertEquals($newSponsor->TeamID, $team->ID, 'Automatic has-many/has-one relation was set correctly on the sponsor');
$this->assertEquals($newSponsor->getComponent('Team')->ID, $team->ID, 'Automatic has-many/has-one relation was set correctly on the sponsor'); $this->assertEquals($newSponsor->getComponent('Team')->ID, $team->ID, 'Automatic has-many/has-one relation was set correctly on the sponsor');
@ -82,7 +82,7 @@ class ComplexTableFieldTest_Controller extends Controller {
} }
function ManyManyForm() { function ManyManyForm() {
$team = DataObject::get_one('ComplexTableFieldTest_Team', "Name = 'The Awesome People'"); $team = DataObject::get_one('ComplexTableFieldTest_Team', "\"Name\" = 'The Awesome People'");
$playersField = new ComplexTableField( $playersField = new ComplexTableField(
$this, $this,
@ -112,7 +112,7 @@ class ComplexTableFieldTest_Controller extends Controller {
} }
function HasManyForm() { function HasManyForm() {
$team = DataObject::get_one('ComplexTableFieldTest_Team', "Name = 'The Awesome People'"); $team = DataObject::get_one('ComplexTableFieldTest_Team', "\"Name\" = 'The Awesome People'");
$sponsorsField = new ComplexTableField( $sponsorsField = new ComplexTableField(
$this, $this,