GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — wordpress-plugin/tests/bootstrap.php at develop · axeptio/wordpress-plugin

Expand file tree

/

bootstrap.php

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
104 lines (96 loc) · 2.48 KB
/

bootstrap.php

Copy path

File metadata and controls

104 lines (96 loc) · 2.48 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/**
* Test bootstrap.
*
* Plugin constants come from tests/constants.php, prepended before the
* Composer autoloader. What is left to set up here is the class autoloader and
* stubs for the few WordPress functions the tested classes call.
*
* @package Axeptio
*/
require_once __DIR__ . '/constants.php';
require_once XPWP_PATH . 'includes/wpcs-autoload.php';
if ( ! function_exists( 'sanitize_text_field' ) ) {
/**
* Minimal stand-in for the WordPress sanitizer.
*
* @param mixed $str Raw value.
* @return string
*/
function sanitize_text_field( $str ) {
return trim( strip_tags( (string) $str ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.strip_tags_strip_tags
}
}
if ( ! function_exists( 'wp_parse_url' ) ) {
/**
* Minimal stand-in for the WordPress URL parser.
*
* @param string $url URL to parse.
* @param int $component Component to retrieve.
* @return mixed
*/
function wp_parse_url( $url, $component = -1 ) {
return parse_url( $url, $component ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
}
}
if ( ! function_exists( 'trailingslashit' ) ) {
/**
* Minimal stand-in for the WordPress path helper.
*
* @param string $value Path.
* @return string
*/
function trailingslashit( $value ) {
return rtrim( $value, '/\\' ) . '/';
}
}
/*
* Settings_Reference falls back to the bundled JSON when the remote fetch does
* not answer 200, so these stubs let the tests resolve types against the copy
* actually shipped with the plugin.
*/
if ( ! function_exists( 'get_transient' ) ) {
/**
* Stand-in returning an always-cold cache.
*
* @param string $key Transient key.
* @return false
*/
function get_transient( $key ) {
return false;
}
}
if ( ! function_exists( 'wp_remote_get' ) ) {
/**
* Stand-in returning an unusable response.
*
* @param string $url Requested URL.
* @param array $args Request arguments.
* @return array
*/
function wp_remote_get( $url, $args = array() ) {
return array();
}
}
if ( ! function_exists( 'is_wp_error' ) ) {
/**
* Stand-in for the WordPress error check.
*
* @param mixed $thing Value to check.
* @return false
*/
function is_wp_error( $thing ) {
return false;
}
}
if ( ! function_exists( 'wp_remote_retrieve_response_code' ) ) {
/**
* Stand-in returning a non-200 status, forcing the bundled fallback.
*
* @param array $response Response.
* @return int
*/
function wp_remote_retrieve_response_code( $response ) {
return 0;
}
}
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.