Commit 16502ac0 authored by Jeremy Mikola's avatar Jeremy Mikola

Simplify statements that throw exceptions

parent a71ba94a
...@@ -16,9 +16,10 @@ class CachingIteratorTest extends TestCase ...@@ -16,9 +16,10 @@ class CachingIteratorTest extends TestCase
{ {
$iterator = $this->getTraversable([1, 2, 3]); $iterator = $this->getTraversable([1, 2, 3]);
$this->assertSame([1, 2, 3], iterator_to_array($iterator)); $this->assertSame([1, 2, 3], iterator_to_array($iterator));
$this->expectException(Exception::class); $this->expectException(Exception::class);
$this->expectExceptionMessage('Cannot traverse an already closed generator'); $this->expectExceptionMessage('Cannot traverse an already closed generator');
$this->assertSame([1, 2, 3], iterator_to_array($iterator)); iterator_to_array($iterator);
} }
public function testConstructorRewinds() public function testConstructorRewinds()
......
...@@ -122,8 +122,9 @@ class CreateIndexesFunctionalTest extends FunctionalTestCase ...@@ -122,8 +122,9 @@ class CreateIndexesFunctionalTest extends FunctionalTestCase
]; ];
$operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes);
$this->expectException(RuntimeException::class); $this->expectException(RuntimeException::class);
$createdIndexNames = $operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
} }
public function testDefaultWriteConcernIsOmitted() public function testDefaultWriteConcernIsOmitted()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment