HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/apklausos/vendor/html2text/html2text/test/SearchReplaceTest.php
<?php

namespace Html2Text;

use PHPUnit\Framework\TestCase;

class SearchReplaceTest extends TestCase
{
    public function searchReplaceDataProvider() {
        return array(
            'Bold' => array(
                'html'      => 'Hello, &quot;<b>world</b>&quot;!',
                'expected'  => 'Hello, "WORLD"!',
            ),
            'Strong' => array(
                'html'      => 'Hello, &quot;<strong>world</strong>&quot;!',
                'expected'  => 'Hello, "WORLD"!',
            ),
            'Italic' => array(
                'html'      => 'Hello, &quot;<i>world</i>&quot;!',
                'expected'  => 'Hello, "_world_"!',
            ),
            'Header' => array(
                'html'      => '<h1>Hello, world!</h1>',
                'expected'  => "HELLO, WORLD!\n\n",
            ),
            'Table Header' => array(
                'html'      => '<th>Hello, World!</th>',
                'expected'  => "\t\tHELLO, WORLD!\n",
            ),
            'Apostrophe' => array(
                'html'      => 'L&#39;incubateur',
                'expected'  => 'L\'incubateur'
            ),
        );
    }

    /**
     * @dataProvider searchReplaceDataProvider
     */
    public function testSearchReplace($html, $expected)
    {
        $html = new Html2Text($html);
        $this->assertEquals($expected, $html->getText());
    }
}