File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
tests/phpunit/tests/filesystem/wpFilesystemDirect Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Tests for the WP_Filesystem_Direct::exists() method.
4+ *
5+ * @package WordPress
6+ */
7+
8+ /**
9+ * @group admin
10+ * @group filesystem
11+ * @group filesystem-direct
12+ *
13+ * @covers WP_Filesystem_Direct::exists
14+ */
15+ class Tests_Filesystem_WpFilesystemDirect_Exists extends WP_Filesystem_Direct_UnitTestCase {
16+
17+ /**
18+ * Tests that `WP_Filesystem_Direct::exists()` determines that
19+ * a path exists.
20+ *
21+ * @ticket 57774
22+ *
23+ * @dataProvider data_paths_that_exist
24+ *
25+ * @param string $path The path to check.
26+ */
27+ public function test_should_determine_that_a_path_exists ( $ path ) {
28+ $ this ->assertTrue ( self ::$ filesystem ->exists ( self ::$ file_structure ['test_dir ' ]['path ' ] . $ path ) );
29+ }
30+
31+ /**
32+ * Tests that `WP_Filesystem_Direct::exists()` determines that
33+ * a path does not exist.
34+ *
35+ * @ticket 57774
36+ *
37+ * @dataProvider data_paths_that_do_not_exist
38+ *
39+ * @param string $path The path to check.
40+ */
41+ public function test_should_determine_that_a_path_does_not_exist ( $ path ) {
42+ $ this ->assertFalse ( self ::$ filesystem ->exists ( self ::$ file_structure ['test_dir ' ]['path ' ] . $ path ) );
43+ }
44+
45+ }
You can’t perform that action at this time.
0 commit comments