]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Util/ProfilerTest.php
Merge remote-tracking branch 'upstream/2021.12-rc' into api-fixes
[friendica.git] / tests / src / Util / ProfilerTest.php
index 45b29943f507a893be49cf8513f03810dcb7a6ce..9a9492d172d755c684074adbccced93390a427c8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -21,8 +21,8 @@
 
 namespace Friendica\Test\src\Util;
 
-use Friendica\Core\Config\Cache;
-use Friendica\Core\Config\IConfig;
+use Friendica\Core\Config\ValueObject\Cache;
+use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Test\MockedTest;
 use Friendica\Util\Profiler;
 use Mockery\MockInterface;
@@ -35,7 +35,7 @@ class ProfilerTest extends MockedTest
         */
        private $logger;
 
-       protected function setUp()
+       protected function setUp(): void
        {
                parent::setUp();
 
@@ -53,6 +53,8 @@ class ProfilerTest extends MockedTest
                            ->andReturn(true)
                            ->twice();
                $profiler = new Profiler($configCache);
+
+               self::assertInstanceOf(Profiler::class, $profiler);
        }
 
        /**
@@ -97,14 +99,14 @@ class ProfilerTest extends MockedTest
                                'name' => 'rendering',
                                'functions' => ['test', 'it7'],
                        ],
-                       'parser' => [
+                       'session' => [
                                'timestamp' => time(),
-                               'name' => 'parser',
+                               'name' => 'session',
                                'functions' => ['test', 'it8'],
                        ],
                        'marktime' => [
                                'timestamp' => time(),
-                               'name' => 'parser',
+                               'name' => 'session',
                                'functions' => ['test'],
                        ],
                        // This one isn't set during reset
@@ -141,7 +143,7 @@ class ProfilerTest extends MockedTest
         * Test the Profiler reset
         * @dataProvider dataPerformance
         */
-       public function testReset($timestamp, $name, array $functions)
+       public function testReset($timestamp, $name)
        {
                $configCache = \Mockery::mock(Cache::class);
                $configCache->shouldReceive('get')
@@ -254,7 +256,7 @@ class ProfilerTest extends MockedTest
 
                $profiler->saveTimestamp(time(), 'network', 'test1');
 
-               $config = \Mockery::mock(IConfig::class);
+               $config = \Mockery::mock(IManageConfigValues::class);
                $config->shouldReceive('get')
                            ->with('system', 'profiler')
                            ->andReturn(false)