[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/tests/tests/utilities/ -> next_decimal.php (source)

   1  <?php
   2  
   3  /**
   4   * Utilities
   5   *
   6   * @group utils
   7   */
   8  
   9  class NextDecimal_Tests extends PHPUnit\Framework\TestCase {
  10  
  11      public function test_get_next_decimal() {
  12          $id = yourls_get_next_decimal();
  13          $this->assertIsInt($id);
  14      }
  15  
  16      public function test_update_next_decimal_no_arg() {
  17          $id = yourls_get_next_decimal();
  18          yourls_update_next_decimal();
  19          $next = yourls_get_next_decimal();
  20          $this->assertSame($next, $id + 1);
  21      }
  22  
  23      public function test_update_next_decimal_with_arg() {
  24          $rand   = mt_rand(1500,2000);
  25          yourls_update_next_decimal($rand);
  26          $next = yourls_get_next_decimal();
  27          $this->assertSame($next, $rand);
  28      }
  29  
  30  }


Generated: Sat Nov 9 05:10:01 2024 Cross-referenced by PHPXref 0.7.1