From f2b6b213debe56d93fce61db284e3f6b1f4368ac Mon Sep 17 00:00:00 2001 From: Timur Shagiakhmetov Date: Thu, 6 Feb 2020 15:29:05 +0000 Subject: [PATCH] fixed tests --- src/Badoo/LiveProfiler/LiveProfiler.php | 20 +++++++++---------- .../Badoo/LiveProfiler/LiveProfilerTest.php | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Badoo/LiveProfiler/LiveProfiler.php b/src/Badoo/LiveProfiler/LiveProfiler.php index 7efa1a6..e602b91 100644 --- a/src/Badoo/LiveProfiler/LiveProfiler.php +++ b/src/Badoo/LiveProfiler/LiveProfiler.php @@ -173,7 +173,7 @@ public function useXhprof() { if ($this->is_enabled) { $this->Logger->warning('can\'t change profiler after profiling started'); - return false; + return $this; } $this->start_callback = function () { @@ -184,14 +184,14 @@ public function useXhprof() return xhprof_disable(); }; - return true; + return $this; } public function useXhprofSample() { if ($this->is_enabled) { $this->Logger->warning('can\'t change profiler after profiling started'); - return false; + return $this; } if (!ini_get('xhprof.sampling_interval')) { @@ -211,7 +211,7 @@ public function useXhprofSample() return $this->convertSampleDataToCommonFormat(xhprof_sample_disable()); }; - return true; + return $this; } protected function convertSampleDataToCommonFormat(array $sampling_data) @@ -259,7 +259,7 @@ public function useTidyWays() { if ($this->is_enabled) { $this->Logger->warning('can\'t change profiler after profiling started'); - return false; + return $this; } $this->start_callback = function () { @@ -270,14 +270,14 @@ public function useTidyWays() return tideways_xhprof_disable(); }; - return true; + return $this; } public function useUprofiler() { if ($this->is_enabled) { $this->Logger->warning('can\'t change profiler after profiling started'); - return false; + return $this; } $this->start_callback = function () { @@ -288,14 +288,14 @@ public function useUprofiler() return uprofiler_disable(); }; - return true; + return $this; } public function useSimpleProfiler() { if ($this->is_enabled) { $this->Logger->warning('can\'t change profiler after profiling started'); - return false; + return $this; } $this->start_callback = function () { @@ -306,7 +306,7 @@ public function useSimpleProfiler() return \Badoo\LiveProfiler\SimpleProfiler::getInstance()->disable(); }; - return true; + return $this; } /** diff --git a/tests/unit/Badoo/LiveProfiler/LiveProfilerTest.php b/tests/unit/Badoo/LiveProfiler/LiveProfilerTest.php index 4a2f236..4f65d4e 100644 --- a/tests/unit/Badoo/LiveProfiler/LiveProfilerTest.php +++ b/tests/unit/Badoo/LiveProfiler/LiveProfilerTest.php @@ -53,7 +53,7 @@ public function testStart() $ProfilerMock ->setDivider(1) ->setStartCallback(function () { - }); + }); $result = $ProfilerMock->start(); self::assertTrue($result); @@ -98,7 +98,7 @@ public function testStartTotal() $ProfilerMock ->setTotalDivider(1) ->setStartCallback(function () { - }); + }); $result = $ProfilerMock->start(); self::assertTrue($result); @@ -124,8 +124,8 @@ public function testEnd() $ProfilerMock ->setDataPacker($DataPacker) ->setEndCallback(function () { - return ['end result']; - }); + return ['end result']; + }); $result = $ProfilerMock->end(); self::assertTrue($result);