mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
MINOR Fixed where clauses to use ANSI compatible SQL in UserDefinedFormEditorTest
This commit is contained in:
parent
3fe18477d8
commit
4cfe303989
@ -22,7 +22,8 @@ class UserDefinedFormEditorTest extends FunctionalTest {
|
||||
$id = $this->form->ID;
|
||||
$this->form->Fields()->add(new EditableFormField());
|
||||
$this->form->doPublish();
|
||||
$live = Versioned::get_one_by_stage("UserDefinedForm", "Live", "UserDefinedForm.ID = $id");
|
||||
$whereClause = defined('Database::USE_ANSI_SQL') ? "\"UserDefinedForm\".\"ID\" = $id" : "UserDefinedForm.ID = $id";
|
||||
$live = Versioned::get_one_by_stage("UserDefinedForm", "Live", $whereClause);
|
||||
$this->assertEquals($live->Fields()->Count(), 1);
|
||||
}
|
||||
|
||||
@ -31,8 +32,9 @@ class UserDefinedFormEditorTest extends FunctionalTest {
|
||||
$this->form->Fields()->removeAll();
|
||||
$this->form->Fields()->add(new EditableFormField());
|
||||
$this->form->doUnPublish();
|
||||
$live = Versioned::get_one_by_stage("UserDefinedForm", "Live", "UserDefinedForm.ID = $id");
|
||||
$stage = Versioned::get_one_by_stage("UserDefinedForm", "Stage", "UserDefinedForm.ID = $id");
|
||||
$whereClause = defined('Database::USE_ANSI_SQL') ? "\"UserDefinedForm\".\"ID\" = $id" : "UserDefinedForm.ID = $id";
|
||||
$live = Versioned::get_one_by_stage("UserDefinedForm", "Live", $whereClause);
|
||||
$stage = Versioned::get_one_by_stage("UserDefinedForm", "Stage", $whereClause);
|
||||
$this->assertEquals($live, false);
|
||||
$this->assertEquals($stage->Fields()->Count(), 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user