[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/tests/inc/ -> common_inlineSVG.test.php (source)

   1  <?php
   2  
   3  class common_embedSVG_test extends DokuWikiTest {
   4  
   5      /**
   6       * embed should succeed with a cleaned up result
   7       */
   8      function test_success() {
   9          $file = mediaFN('wiki:test.svg');
  10          $clean =
  11              '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" '.
  12              'width="64" height="64" viewBox="0 0 64 64"><path d="M64 20l-32-16-32 16 32 16 32-16zM32 '.
  13              '9.311l21.379 10.689-21.379 10.689-21.379-10.689 21.379-10.689zM57.59 28.795l6.41 3.205-32 16-32-16 '.
  14              '6.41-3.205 25.59 12.795zM57.59 40.795l6.41 3.205-32 16-32-16 6.41-3.205 25.59 12.795z" '.
  15              'fill="#000000"></path></svg>';
  16  
  17          $this->assertEquals($clean, inlineSVG($file));
  18      }
  19  
  20      /**
  21       * embed should fail because of the file size limit
  22       */
  23      function test_fail() {
  24          $file = mediaFN('wiki:test.svg');
  25          $this->assertFalse(inlineSVG($file, 100));
  26      }
  27  
  28  }