[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/tests/tests/api/ -> funcs.php (source)

   1  <?php
   2  
   3  /**
   4   * API functions
   5   *
   6   * @group API
   7   * @since 0.1
   8   */
   9  class API_Func_Tests extends PHPUnit\Framework\TestCase {
  10  
  11      public function api_actions() {
  12          return array(
  13              array( 'shorturl', '' ),
  14              array( 'stats', '' ),
  15              array( 'db-stats', 'db_stats' ),
  16              array( 'url-stats', 'url_stats' ),
  17              array( 'expand', '' ),
  18              array( 'version', '' ),
  19          );
  20      }
  21  
  22      /**
  23       * Check that API actions return an array
  24       *
  25       * @since 0.1
  26       * @dataProvider api_actions
  27       */
  28      public function test_api_actions( $action, $alias ) {
  29          $action = $alias ? $alias : $action;
  30  
  31          $function = 'yourls_api_action_' . $action;
  32  
  33          $this->assertTrue( is_callable( $function ) );
  34          $this->assertTrue( is_array( $function() ) );
  35      }
  36  
  37  }


Generated: Tue Sep 27 05:10:01 2022 Cross-referenced by PHPXref 0.7.1