Try to get existing tests passing

This commit is contained in:
Daniel Hensby 2018-02-26 16:23:18 +00:00
parent 3443417894
commit 642e52b4e6
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
2 changed files with 5 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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'