request( $uri, 'GET', $get_vars ); } function post( $uri, $get_vars = array() ) { $this->request( $uri, 'POST', $get_vars ); } private function request( $uri, $method, $vars ) { $tmp_file_name = tempnam( sys_get_temp_dir(), 'gp-test-request-config' ); if ( !$tmp_file_name) { return false; } $config_vars = array( 'upper_method' => strtoupper( $method ), 'vars' => $vars, 'uri' => $uri, 'gp_config_path' => dirname( __FILE__ ) . '/../unittests-config.php', ); extract( array_map( function( $value ) { return var_export( $value, true ); }, $config_vars ) ); $config_php_code = <<body = ob_get_contents(); ob_end_clean(); } function assertRedirect() { $this->assertTrue( gp_startswith( $this->body, 'Redirecting to: ') ); } function assertResponseContains( $needle ) { $this->assertTrue( gp_in( $needle, $this->body ) ); } function assertResponseNotContains( $needle ) { $this->assertFalse( gp_in( $needle, $this->body ) ); } }