diff --git a/src/Writer.php b/src/Writer.php index 557f0342..934b0e37 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -265,7 +265,7 @@ public function setFlushThreshold($threshold): self throw new TypeError(sprintf(__METHOD__.'() expects 1 Argument to be null or an integer %s given', gettype($threshold))); } - if (null !== $threshold && 1 >= $threshold) { + if (null !== $threshold && 1 > $threshold) { throw new Exception(__METHOD__.'() expects 1 Argument to be null or a valid integer greater or equal to 1'); } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 373b225e..5d056b06 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -40,10 +40,17 @@ public function tearDown() */ public function testflushThreshold() { - $this->expectException(Exception::class); $this->csv->setFlushThreshold(12); $this->assertSame(12, $this->csv->getFlushThreshold()); - $this->csv->setFlushThreshold(12); + } + + /** + * @covers ::setFlushThreshold + */ + public function testflushThresholdThrowsException() + { + $this->csv->setFlushThreshold(1); + $this->expectException(Exception::class); $this->csv->setFlushThreshold(0); }