/** * @expectedException \Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException */ public function testNonFileResourceDecrypt() { /* This should behave equivalently to an empty file. Calling fstat() on stdin returns a result saying it has zero size. */ $stdin = fopen('php://stdin', 'r'); $output = fopen('php://memory', 'wb'); try { File::decryptResource($stdin, $output, $this->key); } catch (Exception $ex) { fclose($output); fclose($stdin); throw $ex; } }