Changeset 38164 for trunk/tests/phpunit/tests/http/functions.php
- Timestamp:
- 07/27/2016 03:31:48 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/http/functions.php
r37989 r38164 108 108 } 109 109 110 /** 111 * @ticket 37437 112 */ 113 function test_get_response_cookies_with_wp_http_cookie_object() { 114 $url = 'http://example.org'; 115 116 $response = wp_remote_get( $url, array( 117 'cookies' => array( 118 new WP_Http_Cookie( array( 'name' => 'test', 'value' => 'foo' ) ), 119 ), 120 ) ); 121 $cookies = wp_remote_retrieve_cookies( $response ); 122 123 $this->assertNotEmpty( $cookies ); 124 125 $cookie = wp_remote_retrieve_cookie( $response, 'test' ); 126 $this->assertInstanceOf( 'WP_Http_Cookie', $cookie ); 127 $this->assertSame( 'test', $cookie->name ); 128 $this->assertSame( 'foo', $cookie->value ); 129 } 130 131 /** 132 * @ticket 37437 133 */ 134 function test_get_response_cookies_with_name_value_array() { 135 $url = 'http://example.org'; 136 137 $response = wp_remote_get( $url, array( 138 'cookies' => array( 139 'test' => 'foo', 140 ), 141 ) ); 142 $cookies = wp_remote_retrieve_cookies( $response ); 143 144 $this->assertNotEmpty( $cookies ); 145 146 $cookie = wp_remote_retrieve_cookie( $response, 'test' ); 147 $this->assertInstanceOf( 'WP_Http_Cookie', $cookie ); 148 $this->assertSame( 'test', $cookie->name ); 149 $this->assertSame( 'foo', $cookie->value ); 150 } 110 151 }
Note: See TracChangeset
for help on using the changeset viewer.