]> git.mxchange.org Git - friendica.git/commitdiff
Tests
authorMichael <heluecht@pirati.ca>
Tue, 27 Jul 2021 06:17:24 +0000 (06:17 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 27 Jul 2021 06:17:24 +0000 (06:17 +0000)
src/Util/Profiler.php
tests/Util/AppMockTrait.php

index 82f67b0c0583bd833deb071a840e4f253375d21e..189a7e2e065a88c2025c5ed8dd1c146ec68de8c5 100644 (file)
@@ -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)) {
index f48a85380f4f585233408248c42c685a408d6462..4266a4a0238c9fafea32882a102bafa15443a148 100644 (file)
@@ -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)