[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/tests/phpunit/testcases/notifications/ -> template.php (source)

   1  <?php
   2  /**
   3   * @group notifications
   4   * @group template
   5   */
   6  class BP_Tests_Notifications_Template extends BP_UnitTestCase {
   7      /**
   8       * @group pagination
   9       * @group BP_Notifications_Template
  10       */
  11      public function test_bp_notifications_template_should_give_precedence_to_npage_URL_param() {
  12          $request = $_REQUEST;
  13          $_REQUEST['npage'] = '5';
  14  
  15          $at = new BP_Notifications_Template( array(
  16              'page' => 8,
  17          ) );
  18  
  19          $this->assertEquals( 5, $at->pag_page );
  20  
  21          $_REQUEST = $request;
  22      }
  23  
  24      /**
  25       * @group pagination
  26       * @group BP_Notifications_Template
  27       */
  28      public function test_bp_notifications_template_should_reset_0_pag_page_URL_param_to_default_pag_page_value() {
  29          $request = $_REQUEST;
  30          $_REQUEST['npage'] = '0';
  31  
  32          $at = new BP_Notifications_Template( array(
  33              'page' => 8,
  34          ) );
  35  
  36          $this->assertEquals( 8, $at->pag_page );
  37  
  38          $_REQUEST = $request;
  39      }
  40  
  41      /**
  42       * @group pagination
  43       * @group BP_Notifications_Template
  44       */
  45      public function test_bp_notifications_template_should_give_precedence_to_num_URL_param() {
  46          $request = $_REQUEST;
  47          $_REQUEST['num'] = '14';
  48  
  49          $at = new BP_Notifications_Template( array(
  50              'per_page' => 13,
  51          ) );
  52  
  53          $this->assertEquals( 14, $at->pag_num );
  54  
  55          $_REQUEST = $request;
  56      }
  57  
  58      /**
  59       * @group pagination
  60       * @group BP_Notifications_Template
  61       */
  62      public function test_bp_notifications_template_should_reset_0_pag_num_URL_param_to_default_pag_num_value() {
  63          $request = $_REQUEST;
  64          $_REQUEST['num'] = '0';
  65  
  66          $at = new BP_Notifications_Template( array(
  67              'per_page' => 13,
  68          ) );
  69  
  70          $this->assertEquals( 13, $at->pag_num );
  71  
  72          $_REQUEST = $request;
  73      }
  74  }


Generated: Fri Sep 25 01:01:33 2020 Cross-referenced by PHPXref 0.7.1