]> git.mxchange.org Git - friendica.git/commitdiff
Tests
authorMichael <heluecht@pirati.ca>
Tue, 27 Jul 2021 06:22:37 +0000 (06:22 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 27 Jul 2021 06:22:37 +0000 (06:22 +0000)
tests/src/Core/Cache/DatabaseCacheTest.php
tests/src/Core/Lock/DatabaseLockDriverTest.php
tests/src/Core/StorageManagerTest.php
tests/src/Model/ProcessTest.php
tests/src/Model/Storage/DatabaseStorageTest.php
tests/src/Model/Storage/FilesystemStorageTest.php
tests/src/Util/Logger/ProfilerLoggerTest.php

index 458f3faa203f29fafa283889056f3a08740203a7..0d57f7128a9968ece419f547e2293211fd81a285 100644 (file)
@@ -49,6 +49,8 @@ class DatabaseCacheTest extends CacheTest
        {
                $logger = new NullLogger();
                $profiler = Mockery::mock(Profiler::class);
+               $profiler->shouldReceive('startRecording');
+               $profiler->shouldReceive('stopRecording');
                $profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
 
                // load real config to avoid mocking every config-entry which is related to the Database class
index bc4a9a63b8cc7b1148170832cf1027099e3b35e7..f7db9d8b46b13a7021ed68d47a076222e8e136e1 100644 (file)
@@ -51,6 +51,8 @@ class DatabaseLockDriverTest extends LockTest
        {
                $logger   = new NullLogger();
                $profiler = Mockery::mock(Profiler::class);
+               $profiler->shouldReceive('startRecording');
+               $profiler->shouldReceive('stopRecording');
                $profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
 
                // load real config to avoid mocking every config-entry which is related to the Database class
index 618b5e33c4b753c81fd971597522065c637012f9..deb9c4b11fc716b69758732d09525bdce065cde9 100644 (file)
@@ -69,6 +69,8 @@ class StorageManagerTest extends DatabaseTest
                $this->logger = new NullLogger();
 
                $profiler = \Mockery::mock(Profiler::class);
+               $profiler->shouldReceive('startRecording');
+               $profiler->shouldReceive('stopRecording');
                $profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
 
                // load real config to avoid mocking every config-entry which is related to the Database class
index b6e610238ea5d73563eaff63a5e7d5a95da1be9c..0410ff2dedd8155064d8f414270a9d3fd3f3c643 100644 (file)
@@ -27,6 +27,8 @@ class ProcessTest extends DatabaseTest
                $logger = new NullLogger();
 
                $profiler = \Mockery::mock(Profiler::class);
+               $profiler->shouldReceive('startRecording');
+               $profiler->shouldReceive('stopRecording');
                $profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
 
                // load real config to avoid mocking every config-entry which is related to the Database class
index 45793b47af2308f47ed03081bce02ff3fc93e6e1..21d6e18652c03086b741818fd593f5d5a55154e8 100644 (file)
@@ -51,6 +51,8 @@ class DatabaseStorageTest extends StorageTest
        {
                $logger = new NullLogger();
                $profiler = \Mockery::mock(Profiler::class);
+               $profiler->shouldReceive('startRecording');
+               $profiler->shouldReceive('stopRecording');
                $profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
 
                // load real config to avoid mocking every config-entry which is related to the Database class
index deb453a0483b3d2b6b37929f1ebcf54a71408434..ebe29f0c4c49cfcdd061227f01c14aef33327480 100644 (file)
@@ -52,6 +52,8 @@ class FilesystemStorageTest extends StorageTest
        {
                $logger = new NullLogger();
                $profiler = \Mockery::mock(Profiler::class);
+               $profiler->shouldReceive('startRecording');
+               $profiler->shouldReceive('stopRecording');
                $profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
 
                /** @var MockInterface|L10n $l10n */
index 7719292b097969a10347000b129e2e53bbcda2f1..0a63b43814070c623eb0e2ba4d4ea9f5fd537a52 100644 (file)
@@ -59,6 +59,8 @@ class ProfilerLoggerTest extends MockedTest
                $logger = new ProfilerLogger($this->logger, $this->profiler);
 
                $this->logger->shouldReceive($function)->with($message, $context)->once();
+               $this->profiler->shouldReceive('startRecording');
+               $this->profiler->shouldReceive('stopRecording');
                $this->profiler->shouldReceive('saveTimestamp')->with(\Mockery::any(), 'file')->once();
                $logger->$function($message, $context);
        }
@@ -72,6 +74,8 @@ class ProfilerLoggerTest extends MockedTest
                $logger = new ProfilerLogger($this->logger, $this->profiler);
 
                $this->logger->shouldReceive('log')->with(LogLevel::WARNING, 'test', ['a' => 'context'])->once();
+               $this->profiler->shouldReceive('startRecording');
+               $this->profiler->shouldReceive('stopRecording');
                $this->profiler->shouldReceive('saveTimestamp')->with(\Mockery::any(), 'file')->once();
 
                $logger->log(LogLevel::WARNING, 'test', ['a' => 'context']);