GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gv-request-mock.php
Go to the documentation of this file.
1 <?php
2 namespace GV;
3 
4 /** If this file is called directly, abort. */
5 if ( ! defined( 'GRAVITYVIEW_DIR' ) ) {
6  die();
7 }
8 
9 /**
10  * A mock for testing.
11  */
12 class Mock_Request extends Request {
13  /**
14  * @var array The return values.
15  */
16  public $returns = array(
17  'is_view' => false,
18  'is_entry' => false,
19  'is_edit_entry' => false,
20  'is_search' => false,
21  );
22 
23  public function is_view( $return_view = true ) {
24  return $this->__call( __FUNCTION__, func_get_args() );
25  }
26 
27  public function is_entry( $form_id = 0 ) {
28  return $this->__call( __FUNCTION__, func_get_args() );
29  }
30 
31  public function is_edit_entry( $form_id = 0 ) {
32  return $this->__call( __FUNCTION__, func_get_args() );
33  }
34 
35  public function is_search() {
36  return $this->__call( __FUNCTION__, func_get_args() );
37  }
38 
39  public function __call( $function, $args ) {
40  return Utils::get( $this->returns, $function, null );
41  }
42 }
If this file is called directly, abort.
If this file is called directly, abort.
__call( $function, $args)
is_view( $return_view=true)
is_edit_entry( $form_id=0)
if(empty( $created_by)) $form_id