Skip to content
Snippets Groups Projects
Commit 9fb61b42 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #13208 from owncloud/hhvm-streamwrapper-exception

HHVM Workaround: Do not use Exception from Stream.
parents d4355caf df849bb6
No related branches found
No related tags found
No related merge requests found
......@@ -48,20 +48,13 @@ class Test_StreamWrappers extends \Test\TestCase {
//test callback
$tmpFile = OC_Helper::TmpFile('.txt');
$file = 'close://' . $tmpFile;
\OC\Files\Stream\Close::registerCallback($tmpFile, array('Test_StreamWrappers', 'closeCallBack'));
$actual = false;
$callback = function($path) use (&$actual) { $actual = $path; };
\OC\Files\Stream\Close::registerCallback($tmpFile, $callback);
$fh = fopen($file, 'w');
fwrite($fh, 'asd');
try {
fclose($fh);
$this->fail('Expected exception');
} catch (Exception $e) {
$path = $e->getMessage();
$this->assertEquals($path, $tmpFile);
}
}
public static function closeCallBack($path) {
throw new Exception($path);
fclose($fh);
$this->assertSame($tmpFile, $actual);
}
public function testOC() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment