1 | <?php |
||||||
2 | |||||||
3 | namespace Pronamic\WordPress\Pay\Gateways\TargetPay; |
||||||
4 | |||||||
5 | use PHPUnit_Framework_TestCase; |
||||||
6 | use WP_Http; |
||||||
0 ignored issues
–
show
|
|||||||
7 | |||||||
8 | /** |
||||||
9 | * Title: TargetPay remote get tests |
||||||
10 | * Description: |
||||||
11 | * Copyright: 2005-2019 Pronamic |
||||||
12 | * Company: Pronamic |
||||||
13 | * |
||||||
14 | * @author Remco Tolsma |
||||||
15 | * @version 2.0.0 |
||||||
16 | * @since 1.0.0 |
||||||
17 | */ |
||||||
18 | class RemoteGetTest extends \PHPUnit_Framework_TestCase { |
||||||
19 | /** |
||||||
20 | * Pre HTTP request |
||||||
21 | * |
||||||
22 | * @link https://github.com/WordPress/WordPress/blob/3.9.1/wp-includes/class-http.php#L150-L164 |
||||||
23 | * |
||||||
24 | * @param $preempt |
||||||
25 | * @param $request |
||||||
26 | * @param $url |
||||||
27 | * |
||||||
28 | * @return array |
||||||
29 | */ |
||||||
30 | public function pre_http_request( $preempt, $request, $url ) { |
||||||
31 | $response = file_get_contents( dirname( __FILE__ ) . '/Mock/GetIssuersXml200.http', true ); |
||||||
32 | |||||||
33 | $processed_response = WP_Http::processResponse( $response ); |
||||||
34 | |||||||
35 | $processed_headers = WP_Http::processHeaders( $processed_response['headers'], $url ); |
||||||
36 | $processed_headers['body'] = $processed_response['body']; |
||||||
37 | |||||||
38 | return $processed_headers; |
||||||
39 | } |
||||||
40 | |||||||
41 | public function test_get_issuers() { |
||||||
42 | add_filter( 'pre_http_request', array( $this, 'pre_http_request' ), 10, 3 ); |
||||||
0 ignored issues
–
show
The function
add_filter was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
43 | |||||||
44 | $url = 'https://www.targetpay.com/ideal/getissuers.php?format=xml'; |
||||||
45 | |||||||
46 | $response = wp_remote_get( $url ); |
||||||
0 ignored issues
–
show
The function
wp_remote_get was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
47 | |||||||
48 | $this->assertEquals( 200, wp_remote_retrieve_response_code( $response ) ); |
||||||
0 ignored issues
–
show
The function
wp_remote_retrieve_response_code was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
49 | } |
||||||
50 | } |
||||||
51 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths