[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/tests/tests/pages/ -> pages.php (source)

   1  <?php
   2  
   3  /**
   4   * Pages
   5   *
   6   * @group pages
   7   */
   8  
   9  class Pages_Tests extends PHPUnit\Framework\TestCase {
  10  
  11      public function test_page_is_reserved() {
  12          $this->assertTrue( yourls_keyword_is_reserved('examplepage') );
  13      }
  14  
  15      public function test_examplepage() {
  16          $this->assertTrue(yourls_is_page('examplepage'));
  17      }
  18  
  19      public function test_no_page() {
  20          $this->assertFalse(yourls_is_page(rand_str()));
  21      }
  22  
  23      public function test_create_page_and_check_is_reserved() {
  24          $page = rand_str();
  25          if( touch(YOURLS_PAGEDIR . "/$page.php") ) {
  26              $this->assertTrue( yourls_keyword_is_reserved($page) );
  27              $this->assertTrue( yourls_is_page($page) );
  28              unlink(YOURLS_PAGEDIR . "/$page.php");
  29          } else {
  30              $this->markTestSkipped( "Cannot create 'pages/$page'" );
  31          }
  32      }
  33  
  34  }


Generated: Tue Jan 21 05:10:11 2025 Cross-referenced by PHPXref 0.7.1