From e743d554fd16d260acb5ceebf4697696f5543776 Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Tue, 2 Jul 2019 03:31:52 +0900 Subject: [PATCH] Assert that count is zero for an empty pipeline --- tests/Pipeline/SimpleTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Pipeline/SimpleTest.php b/tests/Pipeline/SimpleTest.php index 0b728f7..e26ac23 100644 --- a/tests/Pipeline/SimpleTest.php +++ b/tests/Pipeline/SimpleTest.php @@ -24,6 +24,17 @@ class SimpleTest extends TestCase public function testEmpty() { $this->assertEquals([], iterator_to_array(new Simple())); + + $this->assertSame(0, iterator_count(new Standard())); + } + + public function testEmptyPHPUnitWise() + { + try { + $this->assertCount(0, new Standard()); + } catch (\BadMethodCallException $e) { + $this->markTestIncomplete($e->getMessage()); + } } public function testSingle()