]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/Lock/LockTest.php
Merge remote-tracking branch 'upstream/2019.03-RC' into worker2
[friendica.git] / tests / src / Core / Lock / LockTest.php
index 78f2271e54016bd581b74c542794d7c3b5b03a39..6dc170e51429bdfc659e8979b5e36cdc0e239d86 100644 (file)
@@ -2,12 +2,20 @@
 
 namespace Friendica\Test\src\Core\Lock;
 
-use Friendica\BaseObject;
-use Friendica\Core\Config;
-use Friendica\Test\DatabaseTest;
+use Friendica\Test\MockedTest;
+use Friendica\Test\Util\AppMockTrait;
+use Friendica\Test\Util\VFSTrait;
 
-abstract class LockTest extends DatabaseTest
+abstract class LockTest extends MockedTest
 {
+       use VFSTrait;
+       use AppMockTrait;
+
+       /**
+        * @var int Start time of the mock (used for time operations)
+        */
+       protected $startTime = 1417011228;
+
        /**
         * @var \Friendica\Core\Lock\ILockDriver
         */
@@ -17,25 +25,22 @@ abstract class LockTest extends DatabaseTest
 
        protected function setUp()
        {
+               // Reusable App object
+               $this->setUpVfsDir();
+               $this->mockApp($this->root);
+               $this->app
+                       ->shouldReceive('getHostname')
+                       ->andReturn('friendica.local');
+
                parent::setUp();
                $this->instance = $this->getInstance();
                $this->instance->releaseAll();
-
-               // Reusable App object
-               $this->app = BaseObject::getApp();
-
-               // Default config
-               Config::set('config', 'hostname', 'localhost');
-               Config::set('system', 'throttle_limit_day', 100);
-               Config::set('system', 'throttle_limit_week', 100);
-               Config::set('system', 'throttle_limit_month', 100);
-               Config::set('system', 'theme', 'system_theme');
        }
 
        protected function tearDown()
        {
-               parent::tearDown();
                $this->instance->releaseAll();
+               parent::tearDown();
        }
 
        /**