1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
||
13 | class Test_Version_Selector extends TestCase { |
||
14 | |||
15 | /** |
||
16 | * This is called before each test. |
||
17 | * |
||
18 | * @before |
||
19 | */ |
||
20 | public function set_up() { |
||
23 | |||
24 | /** |
||
25 | * Tests is_version_update_required(). |
||
26 | * |
||
27 | * @param String $selected_version The currently selected package version. |
||
28 | * @param String $compare_version The package version that is being compared to the |
||
29 | * currently selected version to determine if the version |
||
30 | * needs to be updated. |
||
31 | * @param bool $expected The expected Version_Selector::is_version_update_required() output. |
||
32 | * |
||
33 | * @covers Version_Selector::is_version_update_required |
||
34 | * @dataProvider is_version_update_required_provider |
||
35 | * @dataProvider is_version_update_required_without_dev_constant_provider |
||
36 | */ |
||
37 | public function test_is_version_update_required( $selected_version, $compare_version, $expected ) { |
||
40 | |||
41 | /** |
||
42 | * Tests is_version_update_required() with the JETPACK_AUTOLOAD_DEV constant set to true. |
||
43 | * |
||
44 | * @param String $selected_version The currently selected package version. |
||
45 | * @param String $compare_version The package version that is being compared to the |
||
46 | * currently selected version to determine if the version |
||
47 | * needs to be updated. |
||
48 | * @param bool $expected The expected Version_Selector::is_version_update_required() output. |
||
49 | * |
||
50 | * @covers Version_Selector::is_version_update_required |
||
51 | * @dataProvider Test_Version_Selector::is_version_update_required_provider |
||
52 | * @dataProvider is_version_update_required_with_dev_constant_provider |
||
53 | * @runInSeparateProcess |
||
54 | * @preserveGlobalState disabled |
||
55 | */ |
||
56 | public function test_is_version_update_required_with_dev_constant( $selected_version, $compare_version, $expected ) { |
||
60 | |||
61 | /** |
||
62 | * Data provider for the is_version_update_required() unit tests. |
||
63 | * |
||
64 | * This data provider covers inputs that are not affected by the JETPACK_AUTOLOAD_DEV |
||
65 | * constant. |
||
66 | * |
||
67 | * @return Array The test data. |
||
68 | */ |
||
69 | public static function is_version_update_required_provider() { |
||
81 | |||
82 | /** |
||
83 | * Data provider for the is_version_update_required() unit tests. |
||
84 | * |
||
85 | * This data provider covers inputs that are affected by the JETPACK_AUTOLOAD_DEV |
||
86 | * constant. The expected outputs in this provider are for environments where the |
||
87 | * JETPACK_AUTOLOAD_DEV constant is not set. |
||
88 | * |
||
89 | * @return Array The test data. |
||
90 | */ |
||
91 | public static function is_version_update_required_without_dev_constant_provider() { |
||
97 | |||
98 | /** |
||
99 | * Data provider for the is_version_update_required() unit tests. |
||
100 | * |
||
101 | * This data provider covers inputs that are affected by the JETPACK_AUTOLOAD_DEV |
||
102 | * constant. The expected outputs in this provider are for environments where the |
||
103 | * JETPACK_AUTOLOAD_DEV constant is set to 'true'. |
||
104 | * |
||
105 | * @return Array The test data. |
||
106 | */ |
||
107 | public function is_version_update_required_with_dev_constant_provider() { |
||
113 | } |
||
114 |