Code Duplication    Length = 7-8 lines in 3 locations

tests/Extension/ControllerExtensionTest.php 3 locations

@@ 57-64 (lines=8) @@
54
        $this->controller->extend('onAfterInit');
55
56
        $self = $this;
57
        DebugBar::withDebugBar(function (\DebugBar\DebugBar $debugbar) use ($self) {
58
            $timeData = $debugbar->getCollector('time');
59
            $self->assertInstanceOf(TimeDataCollector::class, $timeData);
60
61
            $self->assertFalse($timeData->hasStartedMeasure('cms_init'));
62
            $self->assertFalse($timeData->hasStartedMeasure('init'));
63
            $self->assertTrue($timeData->hasStartedMeasure('handle'));
64
        });
65
    }
66
67
    public function testBeforeCallActionHandler()
@@ 74-80 (lines=7) @@
71
        $this->controller->extend('beforeCallActionHandler', $request, $action);
72
73
        $self = $this;
74
        DebugBar::withDebugBar(function (\DebugBar\DebugBar $debugbar) use ($self) {
75
            $timeData = $debugbar->getCollector('time');
76
            $self->assertInstanceOf(TimeDataCollector::class, $timeData);
77
78
            $self->assertFalse($timeData->hasStartedMeasure('handle'));
79
            $self->assertTrue($timeData->hasStartedMeasure('action'));
80
        });
81
82
        $this->assertTrue($this->controller->beforeCallActionHandlerCalled);
83
    }
@@ 93-99 (lines=7) @@
90
        $this->controller->extend('afterCallActionHandler', $request, $action, $result);
91
92
        $self = $this;
93
        DebugBar::withDebugBar(function (\DebugBar\DebugBar $debugbar) use ($self) {
94
            $timeData = $debugbar->getCollector('time');
95
            $self->assertInstanceOf(TimeDataCollector::class, $timeData);
96
97
            $self->assertFalse($timeData->hasStartedMeasure('action'));
98
            $self->assertTrue($timeData->hasStartedMeasure('after_action'));
99
        });
100
    }
101
}
102