public function createContents(AbstractDatabase $database, $dataDir)
    {
        $template  = file_get_contents(__DIR__.'/../../res/template/config.php.txt');
        $variables = [
            '{{DBTYPE}}'          => $database->type,
            '{{DBLIBRARY}}'       => $database->library,
            '{{DBHOST}}'          => $database->host,
            '{{DBNAME}}'          => $database->name,
            '{{DBUSER}}'          => $database->user,
            '{{DBPASS}}'          => $database->pass,
            '{{WWWROOT}}'         => 'http://localhost/moodle',
            '{{DATAROOT}}'        => $dataDir,
            '{{PHPUNITDATAROOT}}' => $dataDir.'/phpu_moodledata',
            '{{BEHATDATAROOT}}'   => $dataDir.'/behat_moodledata',
            '{{BEHATDUMP}}'       => $dataDir.'/behat_dump',
            '{{BEHATWWWROOT}}'    => 'http://localhost:8000',
            '{{EXTRACONFIG}}'     => self::PLACEHOLDER,
        ];

        return str_replace(array_keys($variables), array_values($variables), $template);
    }