Skip to content

Commit b9a4d39

Browse files
kboduchnyamsprod
authored andcommitted
setFlushThreshold method fix (#290)
setFlushThreshold method fix (#290)
1 parent fa94758 commit b9a4d39

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Writer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public function setFlushThreshold($threshold): self
265265
throw new TypeError(sprintf(__METHOD__.'() expects 1 Argument to be null or an integer %s given', gettype($threshold)));
266266
}
267267

268-
if (null !== $threshold && 1 >= $threshold) {
268+
if (null !== $threshold && 1 > $threshold) {
269269
throw new Exception(__METHOD__.'() expects 1 Argument to be null or a valid integer greater or equal to 1');
270270
}
271271

tests/WriterTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,17 @@ public function tearDown()
4040
*/
4141
public function testflushThreshold()
4242
{
43-
$this->expectException(Exception::class);
4443
$this->csv->setFlushThreshold(12);
4544
$this->assertSame(12, $this->csv->getFlushThreshold());
46-
$this->csv->setFlushThreshold(12);
45+
}
46+
47+
/**
48+
* @covers ::setFlushThreshold
49+
*/
50+
public function testflushThresholdThrowsException()
51+
{
52+
$this->csv->setFlushThreshold(1);
53+
$this->expectException(Exception::class);
4754
$this->csv->setFlushThreshold(0);
4855
}
4956

0 commit comments

Comments
 (0)