PurifierTest.php 1.1 KB

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Tests\Unit;
  3. use Purify;
  4. use Tests\TestCase;
  5. class PurifierTest extends TestCase
  6. {
  7. /** @test */
  8. public function puckTest()
  9. {
  10. $actual = Purify::clean("<span class=\"fa-spin fa\">catgirl spinning around in the interblag</span>");
  11. $expected = '<span>catgirl spinning around in the interblag</span>';
  12. $this->assertEquals($expected, $actual);
  13. $actual = Purify::clean("<p class=\"fa-spin fa\">catgirl spinning around in the interblag</p>");
  14. $expected = '<p>catgirl spinning around in the interblag</p>';
  15. $this->assertEquals($expected, $actual);
  16. $actual = Purify::clean('<a class="navbar-brand d-flex align-items-center" href="https://pixelfed.social" title="Logo"><img src="/img/pixelfed-icon-color.svg" height="30px" class="px-2"><span class="font-weight-bold mb-0 d-none d-sm-block" style="font-size:20px;">pixelfed</span></a>');
  17. $expected = '<a href="https://pixelfed.social" title="Logo" rel="nofollow noreferrer noopener" target="_blank"><span>pixelfed</span></a>';
  18. $this->assertEquals($expected, $actual);
  19. }
  20. }