src/Codeception/Module/WPFilesystem.php
public function makeUploadsDir($path)
    {
        $path = $this->getUploadsPath($path);

        if (is_dir($path)) {
            $this->debug("Uploads folder '{$path}' already exists.");
            return $path;
        }
        try {
            if (!mkdir($path, 0777, true) && !is_dir($path)) {
                throw new ModuleException($this, sprintf('Could not create uploads folder "%s"', $path));
            }
        } catch (ModuleException $e) {
            throw $e;
        } catch (\Exception $e) {
            throw new ModuleException($this, sprintf(
                "Could not create uploads folder '%s'\nreason: %s\nuser: %s",
                $path,
                $e->getMessage(),
                get_current_user()
            ));
        }

        $this->debug("Created uploads folder '{$path}'");

        $this->toClean[] = $path;

        return $path;
    }
public function makeUploadsDir($path)
    {
        $path = $this->getUploadsPath($path);

        if (is_dir($path)) {
            $this->debug("Uploads folder '{$path}' already exists.");
            return $path;
        }
        try {
            if (!mkdir($path, 0777, true) && !is_dir($path)) {
                throw new ModuleException($this, sprintf('Could not create uploads folder "%s"', $path));
            }
        } catch (ModuleException $e) {
            throw $e;
        } catch (\Exception $e) {
            throw new ModuleException($this, sprintf(
                "Could not create uploads folder '%s'\nreason: %s\nuser: %s",
                $path,
                $e->getMessage(),
                get_current_user()
            ));
        }

        $this->debug("Created uploads folder '{$path}'");

        $this->toClean[] = $path;

        return $path;
    }
public function makeUploadsDir ( $ path ) { $ path = $ this -> getUploadsPath ( $ path ) ; if ( is_dir ( $ path ) ) { $ this -> debug ( "Uploads folder '{$path}' already exists." ) ; return $ path ; } try { if ( ! mkdir ( $ path , 0777 , true ) && ! is_dir ( $ path ) ) { throw new ModuleException ( $ this , sprintf ( 'Could not create uploads folder "%s"' , $ path ) ) ; } } catch ( ModuleException $ e ) { throw $ e ; } catch ( \ Exception $ e ) { throw new ModuleException ( $ this , sprintf ( "Could not create uploads folder '%s'\nreason: %s\nuser: %s" , $ path , $ e -> getMessage ( ) , get_current_user ( ) ) ) ; } $ this -> debug ( "Created uploads folder '{$path}'" ) ; $ this -> toClean [ ] = $ path ; return $ path ; }
Creates an empty folder in the WordPress installation uploads folder.

@example
```php
$logsDir = $I->makeUploadsDir('logs/acme');
```

@param string $path The path, relative to the WordPress installation uploads folder, of the folder
to create.

@return string The absolute path to the created folder.

@throws \Codeception\Exception\ModuleException
Creates an empty folder in the WordPress installation uploads folder .