@@ 236-247 (lines=12) @@ | ||
233 | * |
|
234 | * @covers Automattic\Jetpack\Connection\Manager::delete_all_connection_tokens |
|
235 | */ |
|
236 | public function test_delete_all_connection_tokens() { |
|
237 | ( new Plugin( 'plugin-slug-1' ) )->add( 'Plugin Name 1' ); |
|
238 | ||
239 | ( new Plugin( 'plugin-slug-2' ) )->add( 'Plugin Name 2' ); |
|
240 | ||
241 | $stub = $this->createMock( Plugin::class ); |
|
242 | $stub->method( 'is_only' ) |
|
243 | ->willReturn( false ); |
|
244 | $manager = ( new Manager() )->set_plugin_instance( $stub ); |
|
245 | ||
246 | $this->assertFalse( $manager->delete_all_connection_tokens() ); |
|
247 | } |
|
248 | ||
249 | /** |
|
250 | * Unit test for the "Disconnect from WP" functionality. |
|
@@ 254-265 (lines=12) @@ | ||
251 | * |
|
252 | * @covers Automattic\Jetpack\Connection\Manager::disconnect_site_wpcom |
|
253 | */ |
|
254 | public function test_disconnect_site_wpcom() { |
|
255 | ( new Plugin( 'plugin-slug-1' ) )->add( 'Plugin Name 1' ); |
|
256 | ||
257 | ( new Plugin( 'plugin-slug-2' ) )->add( 'Plugin Name 2' ); |
|
258 | ||
259 | $stub = $this->createMock( Plugin::class ); |
|
260 | $stub->method( 'is_only' ) |
|
261 | ->willReturn( false ); |
|
262 | $manager = ( new Manager() )->set_plugin_instance( $stub ); |
|
263 | ||
264 | $this->assertFalse( $manager->disconnect_site_wpcom() ); |
|
265 | } |
|
266 | ||
267 | /** |
|
268 | * Test the `jetpack_connection_custom_caps' method. |