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