Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 43... Línea 43...
43
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
43
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
44
 */
44
 */
45
class behat_transformations extends behat_base {
45
class behat_transformations extends behat_base {
Línea 46... Línea 46...
46
 
46
 
47
    /**
-
 
48
     * @deprecated since Moodle 3.2
-
 
49
     */
-
 
50
    public function prefixed_tablenode_transformations() {
-
 
51
        throw new coding_exception('prefixed_tablenode_transformations() can not be used anymore. ' .
-
 
52
            'Please use tablenode_transformations() instead.');
-
 
53
    }
-
 
54
 
-
 
55
    /**
47
    /**
56
     * Removes escaped argument delimiters.
48
     * Removes escaped argument delimiters.
57
     *
49
     *
58
     * We use double quotes as arguments delimiters and
50
     * We use double quotes as arguments delimiters and
59
     * to add the " as part of an argument we escape it
51
     * to add the " as part of an argument we escape it
Línea 150... Línea 142...
150
    public function arg_insert_wwwroot(string $string): string {
142
    public function arg_insert_wwwroot(string $string): string {
151
        return $this->replace_wwwroot($string);
143
        return $this->replace_wwwroot($string);
152
    }
144
    }
Línea 153... Línea 145...
153
 
145
 
-
 
146
    /**
-
 
147
     * Convert #dirroot# to the dirroot config value, so it is
-
 
148
     * possible to reference files (e.g. fixtures) with an absolute path.
-
 
149
     *
-
 
150
     * @Transform /^((.*)#dirroot#(.*))$/
-
 
151
     * @param string $string
-
 
152
     * @return string
-
 
153
     */
-
 
154
    public function arg_insert_dirroot(string $string): string {
-
 
155
        return $this->replace_dirroot($string);
-
 
156
    }
-
 
157
 
154
    /**
158
    /**
155
     * Replaces $NASTYSTRING vars for a nasty string.
159
     * Replaces $NASTYSTRING vars for a nasty string.
156
     *
160
     *
157
     * Method reused by TableNode tranformation.
161
     * Method reused by TableNode tranformation.
158
     *
162
     *
Línea 203... Línea 207...
203
     */
207
     */
204
    protected function replace_wwwroot(string $string): string {
208
    protected function replace_wwwroot(string $string): string {
205
        global $CFG;
209
        global $CFG;
206
        return str_replace('#wwwroot#', $CFG->wwwroot, $string);
210
        return str_replace('#wwwroot#', $CFG->wwwroot, $string);
207
    }
211
    }
-
 
212
 
-
 
213
    /**
-
 
214
     * Replace #dirroot# with the actual dirroot config value.
-
 
215
     *
-
 
216
     * @param string $string String to attempt the replacement in.
-
 
217
     * @return string
-
 
218
     */
-
 
219
    protected function replace_dirroot(string $string): string {
-
 
220
        global $CFG;
-
 
221
        return str_replace('#dirroot#', $CFG->dirroot, $string);
-
 
222
    }
208
}
223
}