]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Content/SmiliesTest.php
spelling: cached
[friendica.git] / tests / src / Content / SmiliesTest.php
index 4e0859d7c423bced2b038c531dd675a3cf3980bd..a886f1ac0137e320a73f7c4c2f879e05005b4c1f 100644 (file)
@@ -1,5 +1,22 @@
 <?php
 /**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  * Created by PhpStorm.
  * User: benlo
  * Date: 25/03/19
 namespace Friendica\Test\src\Content;
 
 use Friendica\Content\Smilies;
-use Friendica\Test\MockedTest;
-use Friendica\Test\Util\AppMockTrait;
-use Friendica\Test\Util\VFSTrait;
+use Friendica\DI;
+use Friendica\Network\HTTPException\InternalServerErrorException;
+use Friendica\Test\FixtureTest;
 
-class SmiliesTest extends MockedTest
+class SmiliesTest extends FixtureTest
 {
-       use VFSTrait;
-       use AppMockTrait;
-
-       protected function setUp()
+       protected function setUp(): void
        {
                parent::setUp();
-               $this->setUpVfsDir();
-               $this->mockApp($this->root);
-               $this->app->videowidth = 425;
-               $this->app->videoheight = 350;
-               $this->configMock->shouldReceive('get')
-                       ->with('system', 'no_smilies')
-                       ->andReturn(false);
-               $this->configMock->shouldReceive('get')
-                       ->with(false, 'system', 'no_smilies')
-                       ->andReturn(false);
+
+               DI::config()->set('system', 'no_smilies', false);
        }
 
        public function dataLinks()
@@ -52,16 +58,18 @@ class SmiliesTest extends MockedTest
 
        /**
         * Test replace smilies in different texts
+        *
         * @dataProvider dataLinks
         *
         * @param string $text     Test string
         * @param array  $smilies  List of smilies to replace
         * @param string $expected Expected result
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        *
+        * @throws InternalServerErrorException
         */
-       public function testReplaceFromArray($text, $smilies, $expected)
+       public function testReplaceFromArray(string $text, array $smilies, string $expected)
        {
                $output = Smilies::replaceFromArray($text, $smilies);
-               $this->assertEquals($expected, $output);
+               self::assertEquals($expected, $output);
        }
 }