1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
||
25 | class Test_Plugin extends TestCase { |
||
26 | |||
27 | use Options, Hooks; |
||
28 | |||
29 | const PLUGIN_SLUG = 'sample-plugin-slug'; |
||
30 | |||
31 | const PLUGIN_NAME = 'Sample Plugin Name'; |
||
32 | |||
33 | /** |
||
34 | * Sample plugin arguments. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | private $plugin_args = array( |
||
39 | 'url_info' => 'https://example.org/', |
||
40 | ); |
||
41 | |||
42 | /** |
||
43 | * Initialization of the test class |
||
44 | * |
||
45 | * @throws MockEnabledException PHPUnit wasn't able to enable mock functions ¯\_(⊙︿⊙)_/¯. |
||
46 | */ |
||
47 | protected function setUp() { |
||
57 | |||
58 | /** |
||
59 | * Clean up the test environment. |
||
60 | */ |
||
61 | protected function tearDown() { |
||
66 | |||
67 | /** |
||
68 | * Unit test for the `Plugin::add()` method. |
||
69 | * |
||
70 | * @covers Automattic\Jetpack\Connection\Plugin::add |
||
71 | */ |
||
72 | public function test_add() { |
||
79 | |||
80 | /** |
||
81 | * Unit test for the `Plugin::remove()` method. |
||
82 | * |
||
83 | * @depends test_add |
||
84 | * @covers Automattic\Jetpack\Connection\Plugin::remove |
||
85 | */ |
||
86 | public function test_remove() { |
||
92 | |||
93 | /** |
||
94 | * Unit test for the `Plugin:is_only()` method. |
||
95 | * Make sure that the method returns true if either is true: |
||
96 | * 1. It's the last active plugin connection. |
||
97 | * 2. There are no active connections, assuming the plugin has just been removed. |
||
98 | * |
||
99 | * @depends test_remove |
||
100 | * @covers Automattic\Jetpack\Connection\Plugin::is_only |
||
101 | */ |
||
102 | public function test_is_only_active() { |
||
118 | |||
119 | } |
||
120 |