Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 0348efa

Browse files
author
Michael Grauer
committed
BUG: Refs #0283. Fixed AssetstoreModelTest failures created by these changes.
1 parent be8df5a commit 0348efa

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

core/tests/models/base/AssetstoreModelTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ public function testSave()
9494

9595
// create new ones with a different path from existing ones
9696

97-
$assetstoreDao1 = $this->validSaveTestcase('test_assetstore_1', '/testassetstore1/path', '0');
98-
$assetstoreDao2 = $this->validSaveTestcase('test_assetstore_2', '/testassetstore2/path', '1');
99-
$assetstoreDao3 = $this->validSaveTestcase('test_assetstore_3', '/testassetstore3/path', '2');
97+
$assetstoreDao1 = $this->validSaveTestcase('test_assetstore_1', '/testassetstore1/path', 0);
98+
$assetstoreDao2 = $this->validSaveTestcase('test_assetstore_2', '/testassetstore2/path', 1);
99+
$assetstoreDao3 = $this->validSaveTestcase('test_assetstore_3', '/testassetstore3/path', 2);
100100

101101
// make sure one got saved
102102
$found = $this->Assetstore->findBy('name', 'test_assetstore_3');
103103
$this->assertNotEmpty($found);
104104
$savedDao = $found[0];
105+
// explicit cast to get around differences in mysql vs pgsql type handling
106+
$savedDao->type = (int)$savedDao->type;
105107
$this->assertTrue($this->Assetstore->compareDao($assetstoreDao3, $savedDao));
106108

107109
// Incorrect Create Tests
@@ -151,6 +153,8 @@ public function testSave()
151153
$found = $this->Assetstore->findBy('name', $newName);
152154
$this->assertNotEmpty($found);
153155
$foundDao = $found[0];
156+
// explicit cast to get around differences in mysql vs pgsql type handling
157+
$foundDao->type = (int)$foundDao->type;
154158
$this->assertTrue($this->Assetstore->compareDao($foundDao, $assetstoreDao1));
155159
$this->assertEquals($foundDao->getName(), $newName);
156160
$assetstoreDao1->setName($savedName);
@@ -165,6 +169,8 @@ public function testSave()
165169
$found = $this->Assetstore->findBy('path', $newPath);
166170
$this->assertNotEmpty($found);
167171
$foundDao = $found[0];
172+
// explicit cast to get around differences in mysql vs pgsql type handling
173+
$foundDao->type = (int)$foundDao->type;
168174
$this->assertTrue($this->Assetstore->compareDao($foundDao, $assetstoreDao1));
169175
$this->assertEquals($foundDao->getPath(), $newPath);
170176
$assetstoreDao1->setPath($savedPath);
@@ -175,4 +181,4 @@ public function testSave()
175181
$this->Assetstore->delete($assetstoreDao3);
176182
}
177183

178-
}
184+
}

0 commit comments

Comments
 (0)