MDL-44686 behat: limit failure filename length to 255 chars

This commit is contained in:
Marina Glancy 2014-03-19 12:42:56 +08:00
parent 9b8555fbea
commit a2c271ddcb

View File

@ -383,9 +383,9 @@ class behat_hooks extends behat_base {
$filename = $event->getStep()->getParent()->getTitle() . '_' . $event->getStep()->getText();
$filename = preg_replace('/([^a-zA-Z0-9\_]+)/', '-', $filename);
// File name limited to 256 characters. Leaving 4 chars for the file
// File name limited to 255 characters. Leaving 4 chars for the file
// extension as we allow .png for images and .html for DOM contents.
$filename = substr($filename, 0, 251) . '.' . $filetype;
$filename = substr($filename, 0, 250) . '.' . $filetype;
return array($dir, $filename);
}