mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-06-14 00:39:12 +02:00
Try to get existing tests passing
This commit is contained in:
parent
3443417894
commit
642e52b4e6
|
@ -59,7 +59,7 @@ class MultiFormObjectDecorator extends DataExtension {
|
|||
foreach($query->getWhere() as $whereClause) {
|
||||
$from = array_values($query->getFrom());
|
||||
// SQLQuery will automatically add double quotes and single quotes to values, so check against that.
|
||||
if($whereClause == "{$from[0]}.\"MultiFormIsTemporary\" = '1'") {
|
||||
if($whereClause == "{$from[0]}.\"MultiFormIsTemporary\" = '1'" || $whereClause == "{$from[0]}.\"MultiFormIsTemporary\" = 1") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class MultiFormObjectDecoratorTest extends SapphireTest {
|
|||
);
|
||||
|
||||
protected $extraDataObjects = array(
|
||||
'MultiFormObjectDecorator_DataObject'
|
||||
'MultiFormObjectDecorator_DataObject',
|
||||
);
|
||||
|
||||
public function testTemporaryDataFilteredQuery() {
|
||||
|
@ -16,6 +16,7 @@ class MultiFormObjectDecoratorTest extends SapphireTest {
|
|||
->map('Name')
|
||||
->toArray();
|
||||
|
||||
$this->assertCount(2, $records);
|
||||
$this->assertContains('Test 1', $records);
|
||||
$this->assertContains('Test 2', $records);
|
||||
$this->assertNotContains('Test 3', $records);
|
||||
|
@ -28,6 +29,7 @@ class MultiFormObjectDecoratorTest extends SapphireTest {
|
|||
->map('Name')
|
||||
->toArray();
|
||||
|
||||
$this->assertCount(1, $records);
|
||||
$this->assertNotContains('Test 1', $records);
|
||||
$this->assertNotContains('Test 2', $records);
|
||||
$this->assertContains('Test 3', $records);
|
||||
|
@ -35,7 +37,7 @@ class MultiFormObjectDecoratorTest extends SapphireTest {
|
|||
|
||||
}
|
||||
|
||||
class MultiFormObjectDecorator_DataObject extends DataObject {
|
||||
class MultiFormObjectDecorator_DataObject extends DataObject implements TestOnly {
|
||||
|
||||
private static $db = array(
|
||||
'Name' => 'Varchar'
|
||||
|
|
Loading…
Reference in New Issue
Block a user