Make WordPress Core

source: trunk/tests/phpunit/tests/functions/wpRemoteFopen.php @ 56971

Last change on this file since 56971 was 56971, checked in by SergeyBiryukov, 9 months ago

Tests: Improve the @group annotation accuracy and consistency.

Includes removing .php from some older group names, because most of the groups are no longer named based on the file containing the function, and sometimes functions move around, making the file-based group name inaccurate.

Props afercia, aristath, poena, SergeyBiryukov.
See #59647.

  • Property svn:eol-style set to native
File size: 770 bytes
Line 
1<?php
2/**
3 * @group http
4 * @group external-http
5 * @group functions
6 *
7 * @covers ::wp_remote_fopen
8 */
9class Tests_Functions_wpRemoteFopen extends WP_UnitTestCase {
10
11        /**
12         * @ticket 48845
13         */
14        public function test_wp_remote_fopen_empty() {
15                $this->assertFalse( wp_remote_fopen( '' ) );
16        }
17
18        /**
19         * @ticket 48845
20         */
21        public function test_wp_remote_fopen_bad_url() {
22                $this->assertFalse( wp_remote_fopen( 'wp.com' ) );
23        }
24
25        /**
26         * @ticket 48845
27         */
28        public function test_wp_remote_fopen() {
29                // This URL gives a direct 200 response.
30                $url      = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
31                $response = wp_remote_fopen( $url );
32
33                $this->assertIsString( $response );
34                $this->assertSame( 40148, strlen( $response ) );
35        }
36}
Note: See TracBrowser for help on using the repository browser.