Skip to content

Commit

Permalink
More AbstractRow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nozavroni committed Oct 6, 2016
1 parent ad62b8b commit efd7e91
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/CSVelte/Table/RowTest.php
Expand Up @@ -336,7 +336,22 @@ public function testKeyReturnsHeaderWhenAvailable()

public function testRewindReturnsNullWhenInvalid()
{
$reader = new Row([]);
$this->assertNull($reader->rewind());
$row = new Row([]);
$this->assertNull($row->rewind());
}

public function testOffsetGetAndSetAndExistsForImmutable()
{
$row = new Row([0,1,2,3,4,5]);
try {
$this->assertNull($row->offsetSet(0, 'zero'));
} catch (\Exception $e) {
$this->assertEquals('Cannot change immutable column data', $e->getMessage());
}
try {
$this->assertNull($row->offsetUnset(0));
} catch (\Exception $e) {
$this->assertEquals('Cannot change immutable column data', $e->getMessage());
}
}
}

0 comments on commit efd7e91

Please sign in to comment.