From 72bc1238ba2477ac39cb12e995d94d2a9821aea3 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 27 Jul 2021 06:17:24 +0000 Subject: [PATCH] Tests --- src/Util/Profiler.php | 12 ++++++++++++ tests/Util/AppMockTrait.php | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/Util/Profiler.php b/src/Util/Profiler.php index 82f67b0c0..189a7e2e0 100644 --- a/src/Util/Profiler.php +++ b/src/Util/Profiler.php @@ -87,6 +87,12 @@ class Profiler implements ContainerInterface $this->reset(); } + /** + * Start a profiler recording + * + * @param string $value + * @return void + */ public function startRecording(string $value) { if (!$this->enabled) { @@ -96,6 +102,12 @@ class Profiler implements ContainerInterface $this->timestamps[] = ['value' => $value, 'stamp' => microtime(true), 'credit' => 0]; } + /** + * Stop a profiler recording + * + * @param string $callstack + * @return void + */ public function stopRecording(string $callstack = '') { if (!$this->enabled || empty($this->timestamps)) { diff --git a/tests/Util/AppMockTrait.php b/tests/Util/AppMockTrait.php index f48a85380..4266a4a02 100644 --- a/tests/Util/AppMockTrait.php +++ b/tests/Util/AppMockTrait.php @@ -101,6 +101,8 @@ trait AppMockTrait ->andReturn($root->url()); $this->profilerMock = \Mockery::mock(Profiler::class); + $this->profilerMock->shouldReceive('startRecording'); + $this->profilerMock->shouldReceive('stopRecording'); $this->profilerMock->shouldReceive('saveTimestamp'); $this->dice->shouldReceive('create') ->with(Profiler::class)