[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/tests/inc/ -> FulltextPageLookupTest.php (source)

   1  <?php
   2  
   3  // must be run within Dokuwiki
   4  if (!defined('DOKU_INC')) die();
   5  
   6  /**
   7   * Test cases search only in a namespace or exclude a namespace
   8   */
   9  class FulltextPageLookupTest extends DokuWikiTest {
  10  
  11      public function test_inoutns() {
  12          saveWikiText('test:page1', 'Some text', 'Test initialization');
  13          idx_addPage('test:page1');
  14          saveWikiText('ns:page2', 'Other text', 'Test initialization');
  15          idx_addPage('ns:page2');
  16  
  17          $this->assertEquals(['test:page1' => null, 'ns:page2' => null], ft_pageLookup('page'));
  18          $this->assertEquals(['test:page1' => null], ft_pageLookup('page @test'));
  19          $this->assertEquals(['ns:page2' => null], ft_pageLookup('page ^test'));
  20      }
  21  
  22  }