-<?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\Test\MockedTest;
+use Friendica\Test\Util\AppMockTrait;
+use Friendica\Test\Util\VFSTrait;
+
+class SmiliesTest extends MockedTest
+{
+ use VFSTrait;
+ use AppMockTrait;
+
+ protected function setUp()
+ {
+ 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);
+ }
+
+ 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 \Friendica\Network\HTTPException\InternalServerErrorException
+ */
+ public function testReplaceFromArray($text, $smilies, $expected)
+ {
+ $output = Smilies::replaceFromArray($text, $smilies);
+ $this->assertEquals($expected, $output);
+ }
+}