/** * @expectedException \LogicException */ public function testSetContentInvalidContent() { $obj = new KeyValueNode(); $obj->setContent('; invalid'); }
/** * adds a key/value node * * @param string $key * @param string $value * @param string $section * @param string $comment */ public function set($key, $value, $section = null, $comment = '') { if ($this->hasKey($key, $section)) { $this->remove($key, $section); } if (strlen($comment) > 0) { $comment = ' ; ' . $comment; } $node = new KeyValueNode(); $node->setContent($key . '=' . $value . $comment); $this->appendToSection($node, $section); }