19 protected function setUp() : void
21 $this->parent = $this->createMock(Test_ilDatabaseUpdateStep::class);
22 $this->precondition = $this->createMock(Objective::class);
24 $this->step = new \ilDatabaseUpdateStep(
34 $env = $this->createMock(Environment::class);
37 [$this->precondition, $this->precondition],
38 $this->step->getPreconditions($env)
44 $env = $this->createMock(Environment::class);
45 $log = $this->createMock(\ilDatabaseUpdateStepExecutionLog::class);
46 $db = $this->createMock(\ilDBInterface::class);
49 ->method(
"getResource")
50 ->will($this->returnValueMap([
51 [Environment::RESOURCE_DATABASE, $db],
52 [\ilDatabaseUpdateStepExecutionLog::class,
$log]
56 ->expects($this->once(), $this->at(0))
58 ->with(get_class($this->parent), 1);
61 ->expects($this->once(), $this->at(1))
63 ->with(get_class($this->parent), 1);
65 $this->step->achieve($env);
70 $env = $this->createMock(Environment::class);
71 $db = $this->createMock(\ilDBInterface::class);
74 ->method(
"getResource")
75 ->will($this->returnValueMap([
76 [Environment::RESOURCE_DATABASE, $db],
77 [\ilDatabaseUpdateStepExecutionLog::class, null]
81 ->expects($this->once())
86 $this->step->achieve($env);
step_1(\ilDBInterface $db)
This base-class simplifies the creation of (consecutive) database updates.