Skip to content

Commit 41352ab

Browse files
committed
Fix factory tests
Not sure why they're failing on this PR, seems to be unrelated.
1 parent 91dd6b6 commit 41352ab

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/unittests/NDB_Factory_Test.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ function testProject()
239239
*/
240240
function testCandidate()
241241
{
242+
$mockdb = $this->getMockBuilder("\Database")->getMock();
243+
$this->_factory->setDatabase($mockdb);
244+
$mockdb->expects($this->any())
245+
->method('pselectRow')
246+
->willReturn(['DCCID'=>'300001']);
247+
242248
$candID = new CandID("300001");
243249
$this->assertEquals(
244250
Candidate::singleton($candID),
@@ -255,6 +261,14 @@ function testCandidate()
255261
*/
256262
function testTimepoint()
257263
{
264+
$mockdb = $this->getMockBuilder("\Database")->getMock();
265+
$mockconfig = $this->getMockBuilder("\NDB_Config")->getMock();
266+
$this->_factory->setConfig($mockconfig);
267+
$this->_factory->setDatabase($mockdb);
268+
$mockdb->expects($this->any())
269+
->method('pselectRow')
270+
->willReturn(['1']);
271+
258272
$sessionID = new \SessionID("1");
259273
$this->assertEquals(
260274
\TimePoint::singleton($sessionID),

0 commit comments

Comments
 (0)