[Pkg-owncloud-commits] [php-sabre-vobject] 95/128: Making sure that this error is more predictable.
David Prévot
taffit at moszumanska.debian.org
Tue May 20 23:11:06 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabre-vobject.
commit 96b9b9f908d33a68c6fcbcf593731ac23bdbe1bc
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Wed Apr 2 17:59:55 2014 -0400
Making sure that this error is more predictable.
---
lib/Sabre/VObject/Parser/MimeDir.php | 4 +++-
tests/Sabre/VObject/ReaderTest.php | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/Sabre/VObject/Parser/MimeDir.php b/lib/Sabre/VObject/Parser/MimeDir.php
index 473f30f..24b5683 100644
--- a/lib/Sabre/VObject/Parser/MimeDir.php
+++ b/lib/Sabre/VObject/Parser/MimeDir.php
@@ -82,8 +82,10 @@ class MimeDir extends Parser {
fwrite($stream, $input);
rewind($stream);
$this->input = $stream;
- } else {
+ } elseif (is_resource($input)) {
$this->input = $input;
+ } else {
+ throw new \InvalidArgumentException('This parser can only read from strings or streams.');
}
}
diff --git a/tests/Sabre/VObject/ReaderTest.php b/tests/Sabre/VObject/ReaderTest.php
index 577024d..735b912 100644
--- a/tests/Sabre/VObject/ReaderTest.php
+++ b/tests/Sabre/VObject/ReaderTest.php
@@ -428,7 +428,7 @@ ICS;
}
/**
- * @expectedException PHPUnit_Framework_Error_Warning
+ * @expectedException \InvalidArgumentException
*/
public function testReadBrokenInput() {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list