diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-01-09 18:02:28 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-01-09 18:02:28 +0100 |
commit | 9fb61b42f6c531d07f90780aafe2e04bcdc606fe (patch) | |
tree | 4487a053ba27798d0829b4c0c1b4dcaf80e7bf19 /tests | |
parent | d4355cafc6b9bfaa35658a6bb773df79be7463ce (diff) | |
parent | df849bb69a38617a038710afc8b63101202a1701 (diff) | |
download | nextcloud-server-9fb61b42f6c531d07f90780aafe2e04bcdc606fe.tar.gz nextcloud-server-9fb61b42f6c531d07f90780aafe2e04bcdc606fe.zip |
Merge pull request #13208 from owncloud/hhvm-streamwrapper-exception
HHVM Workaround: Do not use Exception from Stream.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/streamwrappers.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/lib/streamwrappers.php b/tests/lib/streamwrappers.php index 9a3b6bc9266..2a8c8676c16 100644 --- a/tests/lib/streamwrappers.php +++ b/tests/lib/streamwrappers.php @@ -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() { |