Skip to content

Commit d64594f

Browse files
fixed testcases for array storage
1 parent ee1defd commit d64594f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/Functional/BaseCommandTestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ protected function createTaskExecution(TaskInterface $task, \DateTime $scheduleT
124124
$execution->setStatus($status);
125125
$this->taskExecutionRepository->save($execution);
126126

127-
$this->getEntityManager()->flush();
127+
if (self::$kernel->getContainer()->has('doctrine')) {
128+
$this->getEntityManager()->flush();
129+
}
128130

129131
return $execution;
130132
}

tests/Functional/Command/DebugTasksCommandTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public function testExecute()
3535
$executions[1]->setResult(strrev($executions[1]->getWorkload()));
3636
$executions[1]->setDuration(0.0001);
3737

38-
$this->getEntityManager()->flush();
38+
if (self::$kernel->getContainer()->has('doctrine')) {
39+
$this->getEntityManager()->flush();
40+
}
3941

4042
$this->commandTester->execute(
4143
[
@@ -62,7 +64,9 @@ public function testExecutePaginated()
6264
$this->createTaskExecution($task, new \DateTime('+1 hour')),
6365
];
6466

65-
$this->getEntityManager()->flush();
67+
if (self::$kernel->getContainer()->has('doctrine')) {
68+
$this->getEntityManager()->flush();
69+
}
6670

6771
$this->commandTester->execute(
6872
[

0 commit comments

Comments
 (0)