1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
||
16 | class VersionSelectorTest extends TestCase { |
||
17 | |||
18 | /** |
||
19 | * This is called before each test. |
||
20 | * |
||
21 | * @before |
||
22 | */ |
||
23 | public function set_up() { |
||
26 | |||
27 | /** |
||
28 | * Tests is_version_update_required(). |
||
29 | * |
||
30 | * @param String $selected_version The currently selected package version. |
||
31 | * @param String $compare_version The package version that is being compared to the |
||
32 | * currently selected version to determine if the version |
||
33 | * needs to be updated. |
||
34 | * @param bool $expected The expected Version_Selector::is_version_update_required() output. |
||
35 | * |
||
36 | * @covers Version_Selector::is_version_update_required |
||
37 | * @dataProvider is_version_update_required_provider |
||
38 | * @dataProvider is_version_update_required_without_dev_constant_provider |
||
39 | */ |
||
40 | public function test_is_version_update_required( $selected_version, $compare_version, $expected ) { |
||
43 | |||
44 | /** |
||
45 | * Tests is_version_update_required() with the JETPACK_AUTOLOAD_DEV constant set to true. |
||
46 | * |
||
47 | * @param String $selected_version The currently selected package version. |
||
48 | * @param String $compare_version The package version that is being compared to the |
||
49 | * currently selected version to determine if the version |
||
50 | * needs to be updated. |
||
51 | * @param bool $expected The expected Version_Selector::is_version_update_required() output. |
||
52 | * |
||
53 | * @covers Version_Selector::is_version_update_required |
||
54 | * @dataProvider is_version_update_required_provider |
||
55 | * @dataProvider is_version_update_required_with_dev_constant_provider |
||
56 | * @runInSeparateProcess |
||
57 | * @preserveGlobalState disabled |
||
58 | */ |
||
59 | public function test_is_version_update_required_with_dev_constant( $selected_version, $compare_version, $expected ) { |
||
63 | |||
64 | /** |
||
65 | * Data provider for the is_version_update_required() unit tests. |
||
66 | * |
||
67 | * This data provider covers inputs that are not affected by the JETPACK_AUTOLOAD_DEV |
||
68 | * constant. |
||
69 | * |
||
70 | * @return Array The test data. |
||
71 | */ |
||
72 | public static function is_version_update_required_provider() { |
||
84 | |||
85 | /** |
||
86 | * Data provider for the is_version_update_required() unit tests. |
||
87 | * |
||
88 | * This data provider covers inputs that are affected by the JETPACK_AUTOLOAD_DEV |
||
89 | * constant. The expected outputs in this provider are for environments where the |
||
90 | * JETPACK_AUTOLOAD_DEV constant is not set. |
||
91 | * |
||
92 | * @return Array The test data. |
||
93 | */ |
||
94 | public static function is_version_update_required_without_dev_constant_provider() { |
||
100 | |||
101 | /** |
||
102 | * Data provider for the is_version_update_required() unit tests. |
||
103 | * |
||
104 | * This data provider covers inputs that are affected by the JETPACK_AUTOLOAD_DEV |
||
105 | * constant. The expected outputs in this provider are for environments where the |
||
106 | * JETPACK_AUTOLOAD_DEV constant is set to 'true'. |
||
107 | * |
||
108 | * @return Array The test data. |
||
109 | */ |
||
110 | public function is_version_update_required_with_dev_constant_provider() { |
||
116 | } |
||
117 |