/** * Test for ConfigFile::getServerCount * * @return void * @test */ public function testGetServerCount() { $this->object->set('Servers/1/x', 1); $this->object->set('Servers/2/x', 2); $this->object->set('Servers/3/x', 3); $this->object->set('Servers/4/x', 4); $this->object->set('ServerDefault', 3); $this->assertEquals(4, $this->object->getServerCount()); $this->object->removeServer(2); $this->object->removeServer(2); $this->assertEquals(2, $this->object->getServerCount()); $this->assertLessThanOrEqual(2, $this->object->get('ServerDefault')); $this->assertEquals(array('Servers' => array(1 => array('x' => 1), 2 => array('x' => 4))), $this->object->getConfig()); $this->assertEquals(array('Servers/1/x' => 1, 'Servers/2/x' => 4), $this->object->getConfigArray()); }