]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Content/SmiliesTest.php
"escapeTags" is finally removed
[friendica.git] / tests / src / Content / SmiliesTest.php
index 40d126e005b99a7a18cb6b9efdec2a7a78c64a4a..2e97b4d400101380609fee54b89b6c4b2652ab06 100644 (file)
@@ -1,69 +1,68 @@
-<?php\r
-/**\r
- * Created by PhpStorm.\r
- * User: benlo\r
- * Date: 25/03/19\r
- * Time: 21:36\r
- */\r
-\r
-namespace Friendica\Test\src\Content;\r
-\r
-use Friendica\Content\Smilies;\r
-use Friendica\Test\MockedTest;\r
-use Friendica\Test\Util\AppMockTrait;\r
-use Friendica\Test\Util\L10nMockTrait;\r
-use Friendica\Test\Util\VFSTrait;\r
-\r
-class SmiliesTest extends MockedTest\r
-{\r
-       use VFSTrait;\r
-       use AppMockTrait;\r
-       use L10nMockTrait;\r
-\r
-       protected function setUp()\r
-       {\r
-               parent::setUp();\r
-               $this->setUpVfsDir();\r
-               $this->mockApp($this->root);\r
-               $this->app->videowidth = 425;\r
-               $this->app->videoheight = 350;\r
-               $this->configMock->shouldReceive('get')\r
-                       ->with('system', 'no_smilies')\r
-                       ->andReturn(false);\r
-               $this->configMock->shouldReceive('get')\r
-                       ->with(false, 'system', 'no_smilies')\r
-                       ->andReturn(false);\r
-       }\r
-\r
-       public function dataLinks()\r
-       {\r
-               return [\r
-                       /** @see https://github.com/friendica/friendica/pull/6933 */\r
-                       'bug-6933-1' => [\r
-                               'data' => '<code>/</code>',\r
-                               'smilies' => ['texts' => [], 'icons' => []],\r
-                               'expected' => '<code>/</code>',\r
-                       ],\r
-                       'bug-6933-2' => [\r
-                               'data' => '<code>code</code>',\r
-                               'smilies' => ['texts' => [], 'icons' => []],\r
-                               'expected' => '<code>code</code>',\r
-                       ],\r
-               ];\r
-       }\r
-\r
-       /**\r
-        * Test replace smilies in different texts\r
-        * @dataProvider dataLinks\r
-        *\r
-        * @param string $text     Test string\r
-        * @param array  $smilies  List of smilies to replace\r
-        * @param string $expected Expected result\r
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException\r
-        */\r
-       public function testReplaceFromArray($text, $smilies, $expected)\r
-       {\r
-               $output = Smilies::replaceFromArray($text, $smilies);\r
-               $this->assertEquals($expected, $output);\r
-       }\r
-}\r
+<?php
+/**
+ * Created by PhpStorm.
+ * User: benlo
+ * Date: 25/03/19
+ * Time: 21:36
+ */
+
+namespace Friendica\Test\src\Content;
+
+use Friendica\Content\Smilies;
+use Friendica\Network\HTTPException\InternalServerErrorException;
+use Friendica\Test\MockedTest;
+use Friendica\Test\Util\AppMockTrait;
+use Friendica\Test\Util\VFSTrait;
+
+class SmiliesTest extends MockedTest
+{
+       use VFSTrait;
+       use AppMockTrait;
+
+       protected function setUp(): void
+       {
+               parent::setUp();
+               $this->setUpVfsDir();
+               $this->mockApp($this->root);
+               $this->configMock->shouldReceive('get')
+                       ->with('system', 'no_smilies')
+                       ->andReturn(false);
+               $this->configMock->shouldReceive('get')
+                       ->with(false, 'system', 'no_smilies')
+                       ->andReturn(false);
+       }
+
+       public function dataLinks()
+       {
+               return [
+                       /** @see https://github.com/friendica/friendica/pull/6933 */
+                       'bug-6933-1' => [
+                               'data' => '<code>/</code>',
+                               'smilies' => ['texts' => [], 'icons' => []],
+                               'expected' => '<code>/</code>',
+                       ],
+                       'bug-6933-2' => [
+                               'data' => '<code>code</code>',
+                               'smilies' => ['texts' => [], 'icons' => []],
+                               'expected' => '<code>code</code>',
+                       ],
+               ];
+       }
+
+       /**
+        * 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 InternalServerErrorException
+        */
+       public function testReplaceFromArray(string $text, array $smilies, string $expected)
+       {
+               $output = Smilies::replaceFromArray($text, $smilies);
+               self::assertEquals($expected, $output);
+       }
+}