Skip to content

Commit

Permalink
Merge 2509b12 into 0d0b12f
Browse files Browse the repository at this point in the history
  • Loading branch information
kboduch committed Mar 24, 2018
2 parents 0d0b12f + 2509b12 commit f962c05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Writer.php
Expand Up @@ -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');
}

Expand Down
11 changes: 9 additions & 2 deletions tests/WriterTest.php
Expand Up @@ -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);
}

Expand Down

0 comments on commit f962c05

Please sign in to comment.