@@ 238-249 (lines=12) @@ | ||
235 | * |
|
236 | * @covers Automattic\Jetpack\Connection\Manager::is_user_connected |
|
237 | */ |
|
238 | public function test_is_user_connected_with_default_user_id_logged_in() { |
|
239 | $this->mock_function( 'get_current_user_id', 1 ); |
|
240 | $access_token = (object) array( |
|
241 | 'secret' => 'abcd1234', |
|
242 | 'external_user_id' => 1, |
|
243 | ); |
|
244 | $this->manager->expects( $this->once() ) |
|
245 | ->method( 'get_access_token' ) |
|
246 | ->will( $this->returnValue( $access_token ) ); |
|
247 | ||
248 | $this->assertTrue( $this->manager->is_user_connected() ); |
|
249 | } |
|
250 | ||
251 | /** |
|
252 | * Test the `is_user_connected` functionality. |
|
@@ 256-267 (lines=12) @@ | ||
253 | * |
|
254 | * @covers Automattic\Jetpack\Connection\Manager::is_user_connected |
|
255 | */ |
|
256 | public function test_is_user_connected_with_user_id_logged_in() { |
|
257 | $this->mock_function( 'absint', 1 ); |
|
258 | $access_token = (object) array( |
|
259 | 'secret' => 'abcd1234', |
|
260 | 'external_user_id' => 1, |
|
261 | ); |
|
262 | $this->manager->expects( $this->once() ) |
|
263 | ->method( 'get_access_token' ) |
|
264 | ->will( $this->returnValue( $access_token ) ); |
|
265 | ||
266 | $this->assertTrue( $this->manager->is_user_connected( 1 ) ); |
|
267 | } |
|
268 | ||
269 | /** |
|
270 | * Unit test for the "Delete all tokens" functionality. |