[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

   1  <?php
   2  
   3  class init_noNS_test extends DokuWikiTest {
   4  
   5      /**
   6       * @dataProvider noNSProvider
   7       */
   8      public function test_noNS($input, $expected)
   9      {
  10          global $conf;
  11          $conf['start'] = 'start';
  12  
  13          $this->assertSame($expected, noNS($input), $input);
  14      }
  15  
  16      public function noNSProvider()
  17      {
  18          return [
  19              ['0:0:0', '0'],
  20              ['0:0:start', 'start'],
  21              ['foo:0', '0'],
  22              ['0', '0'],
  23          ];
  24      }
  25  
  26      /**
  27       * @dataProvider noNSorNSProvider
  28       */
  29      public function test_noNSorNS($input, $expected)
  30      {
  31          global $conf;
  32          $conf['start'] = 'start';
  33  
  34          $this->assertSame($expected, noNSorNS($input), $input);
  35      }
  36  
  37      public function noNSorNSProvider()
  38      {
  39          return [
  40              ['0:0:0', '0'],
  41              ['0:0:start', '0'],
  42              ['0:start', '0'],
  43              ['0:foo', 'foo'],
  44              ['foo:0', '0'],
  45              ['0', '0'],
  46          ];
  47      }
  48  
  49  }
  50  //Setup VIM: ex: et ts=4 :