<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
*/
private $logger;
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
->andReturn(true)
->twice();
$profiler = new Profiler($configCache);
+
+ self::assertInstanceOf(Profiler::class, $profiler);
}
/**
* 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')
->once();
$profiler = new Profiler($configCache);
+ $profiler->startRecording('network');
self::assertFalse($profiler->isRendertime());
self::assertEmpty($profiler->getRendertimeString());
- $profiler->saveTimestamp(time(), 'network', 'test1');
+ $profiler->stopRecording('test1');
$config = \Mockery::mock(IConfig::class);
$config->shouldReceive('get')
$profiler->update($config);
- $profiler->saveTimestamp(time(), 'database', 'test2');
+ $profiler->startRecording('database');
+ $profiler->stopRecording('test2');
self::assertTrue($profiler->isRendertime());
$output = $profiler->getRendertimeString();