diff --git a/src/test/php/PiniTest.php b/src/test/php/PiniTest.php index bc49952..7e6a360 100644 --- a/src/test/php/PiniTest.php +++ b/src/test/php/PiniTest.php @@ -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")); + } } \ No newline at end of file