Browscap\Writer\XmlWriter::renderSectionHeader PHP Method

renderSectionHeader() public method

renders the header for a section
public renderSectionHeader ( string $sectionName ) : Browscap\Writer\WriterInterface
$sectionName string
return Browscap\Writer\WriterInterface
    public function renderSectionHeader($sectionName)
    {
        if ($this->isSilent()) {
            return $this;
        }
        fputs($this->file, '<browscapitem name="' . $this->getFormatter()->formatPropertyName($sectionName) . '">' . PHP_EOL);
        return $this;
    }

Usage Example

Example #1
0
 /**
  * tests rendering the header of one section
  *
  * @group writer
  * @group sourcetest
  */
 public function testRenderSectionHeaderIfSilent()
 {
     $this->object->setSilent(true);
     self::assertSame($this->object, $this->object->renderSectionHeader('test'));
     self::assertSame('', file_get_contents($this->file));
 }