Skip to content

Commit

Permalink
Adjust tearDown() to deal with skipped tests (eliminates "PHP Fatal e…
Browse files Browse the repository at this point in the history
…rror: Call to a member function getObjects() on a non-object").
  • Loading branch information
convissor committed Jan 8, 2012
1 parent 672a922 commit 498f27e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/StreamTest.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ protected function setUp()
*/ */
protected function tearDown() protected function tearDown()
{ {
if (empty($this->bucket)) {
return;
}
foreach ($this->bucket->getObjects() as $object) { foreach ($this->bucket->getObjects() as $object) {
$object->delete(); $object->delete();
} }
Expand Down
3 changes: 3 additions & 0 deletions tests/Test.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ protected function setUp()
*/ */
protected function tearDown() protected function tearDown()
{ {
if (empty($this->bucket)) {
return;
}
foreach ($this->bucket->getObjects() as $object) { foreach ($this->bucket->getObjects() as $object) {
$object->delete(); $object->delete();
} }
Expand Down

0 comments on commit 498f27e

Please sign in to comment.