Changeset View
Changeset View
Standalone View
Standalone View
src/utils/__tests__/PhutilCowsayTestCase.php
Context not available. | |||||
$dir = dirname(__FILE__).'/cowsay/'; | $dir = dirname(__FILE__).'/cowsay/'; | ||||
$tests = array(); | $tests = array(); | ||||
foreach (Filesystem::listDirectory($dir, false) as $test) { | foreach (Filesystem::listDirectory($dir, false) as $test) { | ||||
if (preg_match('/\.test\z/', $test)) { | if (@preg_match('/\.test\z/', $test)) { | ||||
$tests[] = $test; | $tests[] = $test; | ||||
} | } | ||||
} | } | ||||
Context not available. | |||||
$pattern = '/^~~~+$/m'; | $pattern = '/^~~~+$/m'; | ||||
if (!preg_match($pattern, $data)) { | if (!@preg_match($pattern, $data)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Expected cowsay test file "%s" to contain a line of tildes '. | 'Expected cowsay test file "%s" to contain a line of tildes '. | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0