mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-27 03:02:53 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56971 602fd350-edb4-49c9-b593-d223f7449a82
37 lines
770 B
PHP
37 lines
770 B
PHP
<?php
|
|
/**
|
|
* @group http
|
|
* @group external-http
|
|
* @group functions
|
|
*
|
|
* @covers ::wp_remote_fopen
|
|
*/
|
|
class Tests_Functions_wpRemoteFopen extends WP_UnitTestCase {
|
|
|
|
/**
|
|
* @ticket 48845
|
|
*/
|
|
public function test_wp_remote_fopen_empty() {
|
|
$this->assertFalse( wp_remote_fopen( '' ) );
|
|
}
|
|
|
|
/**
|
|
* @ticket 48845
|
|
*/
|
|
public function test_wp_remote_fopen_bad_url() {
|
|
$this->assertFalse( wp_remote_fopen( 'wp.com' ) );
|
|
}
|
|
|
|
/**
|
|
* @ticket 48845
|
|
*/
|
|
public function test_wp_remote_fopen() {
|
|
// This URL gives a direct 200 response.
|
|
$url = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
|
|
$response = wp_remote_fopen( $url );
|
|
|
|
$this->assertIsString( $response );
|
|
$this->assertSame( 40148, strlen( $response ) );
|
|
}
|
|
}
|