Skip to content

Commit

Permalink
Added tests for getSection and getProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
Programie committed Dec 17, 2014
1 parent 64df2f6 commit c31a1bc
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/test/php/PiniTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,36 @@ public function testMergeSave()

unlink($filename);
}

public function testGetSection()
{
$ini = new Pini(__DIR__ . "/../../../examples/example.ini");

$this->assertInstanceOf("com\\selfcoders\\pini\\Section", $ini->getSection("my section"));
}

public function testGetNotExistingSection()
{
$ini = new Pini(__DIR__ . "/../../../examples/example.ini");

$this->assertNull($ini->getSection("not existing section"));
}

public function testGetProperty()
{
$ini = new Pini(__DIR__ . "/../../../examples/example.ini");

$section = $ini->getSection("my section");

$this->assertInstanceOf("com\\selfcoders\\pini\\Property", $section->getProperty("some key"));
}

public function testGetNotExistingProperty()
{
$ini = new Pini(__DIR__ . "/../../../examples/example.ini");

$section = $ini->getSection("my section");

$this->assertNull($section->getProperty("not existing key"));
}
}

0 comments on commit c31a1bc

Please sign in to comment.