66 protected function setUp(): void
75 public function started(
string $class,
int $step):
void 78 public function finished(
string $class,
int $step):
void 81 public function getLastStartedStep(
string $class):
int 85 public function getLastFinishedStep(
string $class):
int 92 $db = $this->createMock(ilDBInterface::class);
94 ilDBStepReader::class => $steps_reader,
95 ilDatabaseUpdateStepExecutionLog::class => $execution_log,
96 Environment::RESOURCE_DATABASE =>
$db 99 $db->expects($this->exactly(3))
102 $this->objective->achieve($env);
104 $this->assertEquals([1,2,4], $this->steps->called);
113 public function started(
string $class,
int $step):
void 115 $this->test->steps->called[] = [
"started", $class, $step];
117 public function finished(
string $class,
int $step):
void 119 $this->test->steps->called[] = [
"finished", $class, $step];
121 public function getLastStartedStep(
string $class):
int 125 public function getLastFinishedStep(
string $class):
int 132 $db = $this->createMock(ilDBInterface::class);
134 ilDBStepReader::class => $steps_reader,
135 ilDatabaseUpdateStepExecutionLog::class => $execution_log,
136 Environment::RESOURCE_DATABASE =>
$db 139 $this->objective->achieve($env);
142 [
"started", Test_ilDatabaseUpdateSteps::class, 1],
144 [
"finished", Test_ilDatabaseUpdateSteps::class, 1],
145 [
"started", Test_ilDatabaseUpdateSteps::class, 2],
147 [
"finished", Test_ilDatabaseUpdateSteps::class, 2],
148 [
"started", Test_ilDatabaseUpdateSteps::class, 4],
150 [
"finished", Test_ilDatabaseUpdateSteps::class, 4]
153 $this->assertEquals($expected, $this->steps->called);
159 public function started(
string $class,
int $step):
void 162 public function finished(
string $class,
int $step):
void 165 public function getLastStartedStep(
string $class):
int 169 public function getLastFinishedStep(
string $class):
int 176 $db = $this->createMock(ilDBInterface::class);
178 ilDBStepReader::class => $steps_reader,
179 ilDatabaseUpdateStepExecutionLog::class => $execution_log,
180 Environment::RESOURCE_DATABASE =>
$db 183 $db->expects($this->exactly(2))
186 $this->objective->achieve($env);
188 $this->assertEquals([2,4], $this->steps->called);
193 $this->expectException(RuntimeException::class);
196 public function started(
string $class,
int $step):
void 199 public function finished(
string $class,
int $step):
void 202 public function getLastStartedStep(
string $class):
int 206 public function getLastFinishedStep(
string $class):
int 211 $db = $this->createMock(ilDBInterface::class);
213 ilDatabaseUpdateStepExecutionLog::class => $execution_log,
214 Environment::RESOURCE_DATABASE =>
$db 216 $this->objective->achieve($env);
ilDatabaseUpdateStepsExecutedObjective $objective
This logs the execution of database update steps.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
prepare(ilDBInterface $db)
Test_ilDatabaseUpdateSteps $steps
__construct(Container $dic, ilPlugin $plugin)
testOnlyExecuteNonExecutedSteps()
testCorrectExecutionOrder()
testExceptionOnNonMatchingStartAndFinished()