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