MDL-38352 behat: Removing extra double quotes escape
This commit is contained in:
@@ -56,7 +56,7 @@ class nasty_strings {
|
||||
'\' \\" \ \'$@NULL@$ @@TEST@@ < > & < > & \\\" \\ , ; : . 日本語% %%',
|
||||
'\\\" \\ , ; : . 日本語% < > & < > & \' \\" \ \'$@NULL@$ @@TEST@@ %%',
|
||||
'< > & < > & \' \\" \ \'$@NULL@$ 日本語% %% @@TEST@@ \\\" \\ . , ; :',
|
||||
'. 日本語& \' \\"< > & < > \\\" \\ , ; : \ \'$@NULL@$ @@TEST@@% %%',
|
||||
'. 日本語& \' \\" < > & < > \\ , ; : \ \'$@NULL@$ \\\" @@TEST@@% %%',
|
||||
'& \' \\" \ < > & < > \\\" \\ , ; : . 日本語\'$@NULL@$ @@TEST@@% %%',
|
||||
);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class behat_transformations extends behat_base {
|
||||
* @return string The string with the arguments fixed.
|
||||
*/
|
||||
public function arg_replace_slashes($string) {
|
||||
return $this->replace_slashes($string);
|
||||
return str_replace('\"', '"', $string);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,8 +73,8 @@ class behat_transformations extends behat_base {
|
||||
/**
|
||||
* Transformations for TableNode arguments.
|
||||
*
|
||||
* All the transformations have to be applied to tables,
|
||||
* adding them in a different method for Behat API restrictions.
|
||||
* Transformations applicable to TableNode arguments should also
|
||||
* be applied, adding them in a different method for Behat API restrictions.
|
||||
*
|
||||
* @Transform /^table:(.*)/
|
||||
* @param TableNode $tablenode
|
||||
@@ -87,9 +87,6 @@ class behat_transformations extends behat_base {
|
||||
foreach ($rows as $rowkey => $row) {
|
||||
foreach ($row as $colkey => $value) {
|
||||
|
||||
// TableNodes values doesn't need to be escaped, but maybe somebody does it.
|
||||
$rows[$rowkey][$colkey] = $this->replace_slashes($value);
|
||||
|
||||
// Transforms vars into nasty strings.
|
||||
if (preg_match('/\$NASTYSTRING(\d)/', $rows[$rowkey][$colkey])) {
|
||||
$rows[$rowkey][$colkey] = $this->replace_nasty_strings($rows[$rowkey][$colkey]);
|
||||
@@ -102,18 +99,6 @@ class behat_transformations extends behat_base {
|
||||
return $tablenode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the escaped double quotes.
|
||||
*
|
||||
* Method reused by TableNode transformation.
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
public function replace_slashes($string) {
|
||||
return str_replace('\"', '"', $string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces $NASTYSTRING vars for a nasty string.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user