19 declare(strict_types=1);
30 require_once __DIR__ .
'/ContainerMock.php';
38 $this->assertInstanceOf(StartUpStep::class,
new StartUpStep($this->mock(ilCtrl::class), $this->mock(Conductor::class)));
43 $instance =
new StartUpStep($this->mock(ilCtrl::class), $this->mock(Conductor::class));
44 $this->assertTrue($instance->shouldStoreRequestTarget());
49 $instance =
new StartUpStep($this->mock(ilCtrl::class), $this->mockTree(Conductor::class, [
'intercepting' => [
50 $this->mockTree(Intercept::class, [
'intercept' =>
false]),
51 $this->mockTree(Intercept::class, [
'intercept' =>
true]),
54 $this->assertTrue($instance->shouldInterceptRequest());
59 $ctrl = $this->mock(ilCtrl::class);
60 $ctrl->expects(self::once())->method(
'setParameterByClass')->with(
'foo',
'id',
'baz');
61 $ctrl->expects(self::once())->method(
'getLinkTargetByClass')->with([
'foo'],
'bar')->willReturn(
'link');
62 $ctrl->expects(self::once())->method(
'redirectToURL')->with(
'link');
64 $instance =
new StartUpStep($ctrl, $this->mockTree(Conductor::class, [
'intercepting' => [
65 $this->mockTree(Intercept::class, [
'intercept' =>
false,
'id' =>
'ho',
'target' => [
'guiName' =>
'dummy',
'guiPath' => [
'dummy'],
'command' =>
'hej']]),
66 $this->mockTree(Intercept::class, [
'intercept' =>
true,
'id' =>
'baz',
'target' => [
'guiName' =>
'foo',
'guiPath' => [
'foo'],
'command' =>
'bar']]),
74 $ctrl = $this->mockTree(ilCtrl::class, [
'getCmdClass' =>
'foo']);
76 $instance =
new StartUpStep($ctrl, $this->mockTree(Conductor::class, [
'intercepting' => [
77 $this->mockTree(Intercept::class, [
'intercept' =>
true,
'target' => [
'guiName' =>
'HEJ']]),
78 $this->mockTree(Intercept::class, [
'intercept' =>
true,
'target' => [
'guiName' =>
'FOO']]),
81 $this->assertTrue($instance->isInFulfillment());
testShouldInterceptRequest()
testShouldStoreRequestTarget()