Changeset 34369 for trunk/tests/phpunit/tests/http/functions.php
- Timestamp:
- 09/22/2015 03:13:13 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/http/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/http/functions.php
r33969 r34369 76 76 $this->assertWPError( $response ); 77 77 } 78 79 /** 80 * @ticket 33711 81 */ 82 function test_get_response_cookies() { 83 $url = 'https://wordpress.org/wp-login.php'; 84 85 $response = wp_remote_head( $url ); 86 $cookies = wp_remote_retrieve_cookies( $response ); 87 88 $this->assertInternalType( 'array', $cookies ); 89 $this->assertNotEmpty( $cookies ); 90 91 $cookie = wp_remote_retrieve_cookie( $response, 'wordpress_test_cookie' ); 92 $this->assertInstanceOf( 'WP_Http_Cookie', $cookie ); 93 $this->assertSame( 'wordpress_test_cookie', $cookie->name ); 94 $this->assertSame( 'WP Cookie check', $cookie->value ); 95 96 $value = wp_remote_retrieve_cookie_value( $response, 'wordpress_test_cookie' ); 97 $this->assertSame( 'WP Cookie check', $value ); 98 99 $no_value = wp_remote_retrieve_cookie_value( $response, 'not_a_cookie' ); 100 $this->assertSame( '', $no_value ); 101 102 $no_cookie = wp_remote_retrieve_cookie( $response, 'not_a_cookie' ); 103 $this->assertSame( '', $no_cookie ); 104 } 105 78 106 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)