|
@@ 200-212 (lines=13) @@
|
| 197 |
|
* |
| 198 |
|
* @covers Automattic\Jetpack\Connection\Manager::is_user_connected |
| 199 |
|
*/ |
| 200 |
|
public function test_is_user_connected_with_default_user_id_logged_in() { |
| 201 |
|
wp_set_current_user( $this->user_id ); |
| 202 |
|
|
| 203 |
|
$access_token = (object) array( |
| 204 |
|
'secret' => 'abcd1234', |
| 205 |
|
'external_user_id' => 1, |
| 206 |
|
); |
| 207 |
|
$this->manager->expects( $this->once() ) |
| 208 |
|
->method( 'get_access_token' ) |
| 209 |
|
->will( $this->returnValue( $access_token ) ); |
| 210 |
|
|
| 211 |
|
$this->assertTrue( $this->manager->is_user_connected() ); |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
/** |
| 215 |
|
* Test the `is_user_connected` functionality. |
|
@@ 219-229 (lines=11) @@
|
| 216 |
|
* |
| 217 |
|
* @covers Automattic\Jetpack\Connection\Manager::is_user_connected |
| 218 |
|
*/ |
| 219 |
|
public function test_is_user_connected_with_user_id_logged_in() { |
| 220 |
|
$access_token = (object) array( |
| 221 |
|
'secret' => 'abcd1234', |
| 222 |
|
'external_user_id' => 1, |
| 223 |
|
); |
| 224 |
|
$this->manager->expects( $this->once() ) |
| 225 |
|
->method( 'get_access_token' ) |
| 226 |
|
->will( $this->returnValue( $access_token ) ); |
| 227 |
|
|
| 228 |
|
$this->assertTrue( $this->manager->is_user_connected( $this->user_id ) ); |
| 229 |
|
} |
| 230 |
|
|
| 231 |
|
/** |
| 232 |
|
* Unit test for the "Delete all tokens" functionality. |