]> git.mxchange.org Git - friendica.git/commitdiff
Revert tests
authorMichael <heluecht@pirati.ca>
Fri, 17 Mar 2023 12:41:26 +0000 (12:41 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 17 Mar 2023 12:41:26 +0000 (12:41 +0000)
tests/src/Content/Text/BBCodeTest.php
tests/src/Factory/Api/Twitter/DirectMessageTest.php
tests/src/Module/Api/Friendica/NotificationTest.php

index 10be79c722892bff7bacead84c511d52e9d3c6d9..16cbec330acea4f508649c804d1d180f60a338ef 100644 (file)
@@ -146,7 +146,7 @@ class BBCodeTest extends FixtureTest
        public function testAutoLinking(string $data, bool $assertHTML)
        {
                $output = BBCode::convert($data);
-               $assert = $this->HTMLPurifier->purify('<p><a href="' . $data . '" target="_blank" rel="noopener noreferrer">' . $data . '</a></p>');
+               $assert = $this->HTMLPurifier->purify('<a href="' . $data . '" target="_blank" rel="noopener noreferrer">' . $data . '</a>');
                if ($assertHTML) {
                        self::assertEquals($assert, $output);
                } else {
@@ -178,74 +178,74 @@ class BBCodeTest extends FixtureTest
 [/ul]',
                        ],
                        'bug-2199-named-size' => [
-                               'expectedHtml' => '<p><span style="font-size:xx-large;line-height:normal;">Test text</span></p>',
+                               'expectedHtml' => '<span style="font-size:xx-large;line-height:normal;">Test text</span>',
                                'text' => '[size=xx-large]Test text[/size]',
                        ],
                        'bug-2199-numeric-size' => [
-                               'expectedHtml' => '<p><span style="font-size:24px;line-height:normal;">Test text</span></p>',
+                               'expectedHtml' => '<span style="font-size:24px;line-height:normal;">Test text</span>',
                                'text' => '[size=24]Test text[/size]',
                        ],
                        'bug-2199-diaspora-no-named-size' => [
-                               'expectedHtml' => '<p>Test text</p>',
+                               'expectedHtml' => 'Test text',
                                'text' => '[size=xx-large]Test text[/size]',
                                'try_oembed' => false,
                                // Triggers the diaspora compatible output
                                'simpleHtml' => BBCode::DIASPORA,
                        ],
                        'bug-2199-diaspora-no-numeric-size' => [
-                               'expectedHtml' => '<p>Test text</p>',
+                               'expectedHtml' => 'Test text',
                                'text' => '[size=24]Test text[/size]',
                                'try_oembed' => false,
                                // Triggers the diaspora compatible output
                                'simpleHtml' => BBCode::DIASPORA,
                        ],
                        'bug-7665-audio-tag' => [
-                               'expectedHtml' => '<p><audio src="http://www.cendrones.fr/colloque2017/jonathanbocquet.mp3" controls><a href="http://www.cendrones.fr/colloque2017/jonathanbocquet.mp3">http://www.cendrones.fr/colloque2017/jonathanbocquet.mp3</a></audio></p>',
+                               'expectedHtml' => '<audio src="http://www.cendrones.fr/colloque2017/jonathanbocquet.mp3" controls><a href="http://www.cendrones.fr/colloque2017/jonathanbocquet.mp3">http://www.cendrones.fr/colloque2017/jonathanbocquet.mp3</a></audio>',
                                'text' => '[audio]http://www.cendrones.fr/colloque2017/jonathanbocquet.mp3[/audio]',
                                'try_oembed' => true,
                        ],
                        'bug-7808-code-lt' => [
-                               'expectedHtml' => '<p><code>&lt;</code></p>',
+                               'expectedHtml' => '<code>&lt;</code>',
                                'text' => '[code]<[/code]',
                        ],
                        'bug-7808-code-gt' => [
-                               'expectedHtml' => '<p><code>&gt;</code></p>',
+                               'expectedHtml' => '<code>&gt;</code>',
                                'text' => '[code]>[/code]',
                        ],
                        'bug-7808-code-amp' => [
-                               'expectedHtml' => '<p><code>&amp;</code></p>',
+                               'expectedHtml' => '<code>&amp;</code>',
                                'text' => '[code]&[/code]',
                        ],
                        'task-8800-pre-spaces-notag' => [
-                               'expectedHtml' => '<p>[test] Space</p>',
+                               'expectedHtml' => '[test] Space',
                                'text' => '[test] Space',
                        ],
                        'task-8800-pre-spaces' => [
-                               'expectedHtml' => '<p>    Spaces</p>',
+                               'expectedHtml' => '    Spaces',
                                'text' => '[pre]    Spaces[/pre]',
                        ],
                        'bug-9611-purify-xss-nobb' => [
-                               'expectedHTML' => '<p><span>dare to move your mouse here</span></p>',
+                               'expectedHTML' => '<span>dare to move your mouse here</span>',
                                'text' => '[nobb]<span onmouseover="alert(0)">dare to move your mouse here</span>[/nobb]'
                        ],
                        'bug-9611-purify-xss-noparse' => [
-                               'expectedHTML' => '<p><span>dare to move your mouse here</span></p>',
+                               'expectedHTML' => '<span>dare to move your mouse here</span>',
                                'text' => '[noparse]<span onmouseover="alert(0)">dare to move your mouse here</span>[/noparse]'
                        ],
                        'bug-9611-purify-xss-attributes' => [
-                               'expectedHTML' => '<p><span>dare to move your mouse here</span></p>',
+                               'expectedHTML' => '<span>dare to move your mouse here</span>',
                                'text' => '[color="onmouseover=alert(0) style="]dare to move your mouse here[/color]'
                        ],
                        'bug-9611-purify-attributes-correct' => [
-                               'expectedHTML' => '<p><span style="color:#FFFFFF;">dare to move your mouse here</span></p>',
+                               'expectedHTML' => '<span style="color:#FFFFFF;">dare to move your mouse here</span>',
                                'text' => '[color=FFFFFF]dare to move your mouse here[/color]'
                        ],
                        'bug-9639-span-classes' => [
-                               'expectedHTML' => '<p><span class="arbitrary classes">Test</span></p>',
+                               'expectedHTML' => '<span class="arbitrary classes">Test</span>',
                                'text' => '[class=arbitrary classes]Test[/class]',
                        ],
                        'bug-10772-duplicated-links' => [
-                               'expectedHTML' => '<p>Jetzt wird mir klar, warum Kapitalisten jedes Mal durchdrehen wenn Marx und das Kapital ins Gespräch kommt. Soziopathen.<br>Karl Marx - Die ursprüngliche Akkumulation<br><a href="https://wohlstandfueralle.podigee.io/107-urspruengliche-akkumulation" target="_blank" rel="noopener noreferrer">https://wohlstandfueralle.podigee.io/107-urspruengliche-akkumulation</a><br>#Podcast #Kapitalismus</p>',
+                               'expectedHTML' => 'Jetzt wird mir klar, warum Kapitalisten jedes Mal durchdrehen wenn Marx und das Kapital ins Gespräch kommt. Soziopathen.<br>Karl Marx - Die ursprüngliche Akkumulation<br><a href="https://wohlstandfueralle.podigee.io/107-urspruengliche-akkumulation" target="_blank" rel="noopener noreferrer">https://wohlstandfueralle.podigee.io/107-urspruengliche-akkumulation</a><br>#Podcast #Kapitalismus',
                                'text' => "Jetzt wird mir klar, warum Kapitalisten jedes Mal durchdrehen wenn Marx und das Kapital ins Gespräch kommt. Soziopathen.
 Karl Marx - Die ursprüngliche Akkumulation
 [url=https://wohlstandfueralle.podigee.io/107-urspruengliche-akkumulation]https://wohlstandfueralle.podigee.io/107-urspruengliche-akkumulation[/url]
@@ -255,7 +255,7 @@ Karl Marx - Die ursprüngliche Akkumulation
                                'simpleHtml' => BBCode::TWITTER,
                        ],
                        'task-10886-deprecate-class' => [
-                               'expectedHTML' => '<p><span class="mastodon emoji"><img src="https://fedi.underscore.world/emoji/custom/custom/heart_nb.png" alt=":heart_nb:" title=":heart_nb:"></span></p>',
+                               'expectedHTML' => '<span class="mastodon emoji"><img src="https://fedi.underscore.world/emoji/custom/custom/heart_nb.png" alt=":heart_nb:" title=":heart_nb:"></span>',
                                'text' => '[emoji=https://fedi.underscore.world/emoji/custom/custom/heart_nb.png]:heart_nb:[/emoji]',
                        ]
                ];
index 62a9c43e59d744d43ae392e8f2a1cc50b1910d2a..216c4051fafff6dd1d4fe2ab6e1d57fede819aba 100644 (file)
@@ -67,7 +67,7 @@ class DirectMessageTest extends FixtureTest
                        ->toArray();
 
                self::assertEquals('item_title', $directMessage['title']);
-               self::assertEquals('<p><strong>item_body</strong></p>', $directMessage['text']);
+               self::assertEquals('<strong>item_body</strong>', $directMessage['text']);
        }
 
        /**
index e9eafc9330b5dfa2dfeccdac7fc0644f907fe886..aaf7022024899a75bb2cb1cd58cdfdef96b711f9 100644 (file)
@@ -62,7 +62,7 @@ class NotificationTest extends ApiTest
                $assertXml = <<<XML
 <?xml version="1.0"?>
 <notes>
-  <note date="$date" date_rel="$dateRel" id="1" iid="4" link="http://localhost/display/1" msg="A test reply from an item" msg_cache="A test reply from an item" msg_html="&lt;p&gt;A test reply from an item&lt;/p&gt;" msg_plain="A test reply from an item" name="Friend contact" name_cache="Friend contact" otype="item" parent="" photo="http://localhost/" seen="false" timestamp="1577880722" type="8" uid="42" url="http://localhost/profile/friendcontact" verb="http://activitystrea.ms/schema/1.0/post"/>
+  <note date="$date" date_rel="$dateRel" id="1" iid="4" link="http://localhost/display/1" msg="A test reply from an item" msg_cache="A test reply from an item" msg_html="A test reply from an item" msg_plain="A test reply from an item" name="Friend contact" name_cache="Friend contact" otype="item" parent="" photo="http://localhost/" seen="false" timestamp="1577880722" type="8" uid="42" url="http://localhost/profile/friendcontact" verb="http://activitystrea.ms/schema/1.0/post"/>
 </notes>
 XML;