You are here

public function TypogrifySmartyPantsTest::providerTypogrifyExamples in Typogrify 8

Provides test data for ::testTypogrify().

File

tests/src/Kernel/TypogrifySmartyPantsTest.php, line 57

Class

TypogrifySmartyPantsTest
Test the application of the full package of Typogrify and SmartyPants.

Namespace

Drupal\Tests\typogrify\Kernel

Code

public function providerTypogrifyExamples() {
  $before = <<<HTML
<h2>"Jayhawks" & KU fans act extremely obnoxiously</h2>
<p>By J.D. Salinger, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "Excepteur sint occaecat 'cupidatat' non proident" sunt RFID22 in.... </p>
HTML;
  $after = <<<HTML
<h2>“Jayhawks” <span class="amp">&amp;</span> <span class="caps">KU</span> fans act extremely&nbsp;obnoxiously</h2>
<p>By <span class="caps">J.D.</span> Salinger, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. “Excepteur sint occaecat ‘cupidatat’ non proident” sunt <span class="caps">RFID22</span>&nbsp;in&#8230;. </p>
HTML;

  // Original example compatibility test.
  $data = [
    'original typogrify example' => [
      [],
      $before,
      $after,
    ],
    'test wrap_abbr' => [
      [
        'wrap_abbr' => 3,
      ],
      "What kind of abbreviations contain two dots like eg.etc. or cd.e.f.?",
      'What kind of abbreviations contain two dots like <span class="abbr">eg.<span style="margin-left:0.167em"><span style="display:none">&nbsp;</span></span>etc.</span> or <span class="abbr">cd.<span style="margin-left:0.167em"><span style="display:none">&nbsp;</span></span>e.<span style="margin-left:0.167em"><span style="display:none">&nbsp;</span></span>f.</span>?',
    ],
    'test wrap_numbers' => [
      [
        'wrap_numbers' => 4,
      ],
      "Mathematicians refer to 1729 as Ramanujan's number. Euler proved that e^(π i) = -1, where π is approximately 3.1415926.",
      'Mathematicians refer to <span class="number">1729</span> as Ramanujan&#8217;s number. Euler proved that e^(π i) = <span class="number">-1</span>, where π is approximately <span class="number">3.1415926</span>.',
    ],
  ];
  return $data;
}