Example #1
0
 /**
  * @covers ::deleteSection
  * @covers ::deleteAllSections
  */
 public function testDeleteSection()
 {
     // init test environment
     $config = new Config($this->test_base_dir);
     $parameters_section_settings = array('foo' => 'bar');
     $config->setSection('parameters', $parameters_section_settings);
     // pre test
     $this->assertTrue($config->getSection('say') !== null);
     $this->assertEquals(array_merge(array('say' => $config->getSection('say')), array('parameters' => $parameters_section_settings)), $config->getAllSections());
     // call action to test
     $config->deleteSection('say');
     // post test
     $this->assertFalse($config->getSection('say') !== null);
     $this->assertEquals(array('parameters' => $parameters_section_settings), $config->getAllSections());
     // second test
     $config->deleteAllSections();
     $this->assertEmpty($config->getAllSections());
 }