/** * Test deleting a directory recursively. * * @since 0.1.0 */ public function test_rmdir_recursive() { $this->assertTrue($this->mock_fs->add_file('/test', array('type' => 'dir'))); $this->assertTrue($this->mock_fs->add_file('/test/a.txt')); $this->assertTrue($this->fs->rmdir('/test', true)); $this->assertFalse($this->fs->exists('/test')); $this->assertFalse($this->fs->exists('/test/a.txt')); }
/** * @since 0.1.0 */ public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { if (!$chmod) { $chmod = FS_CHMOD_DIR; } $args = array('type' => 'dir', 'mode' => $chmod); if ($chown) { $args['owner'] = $chown; } if ($chgrp) { $args['group'] = $chgrp; } return self::$mock->add_file($path, $args); }
/** * Test deleting a nonexistent file. * * @since 0.1.0 */ public function test_delete_nonexistent_file() { $this->assertFalse($this->mock->delete('/test.txt')); $this->assertFalse($this->mock->exists('/test.txt')); }