Ejemplo n.º 1
0
    /**
     * Tests whether the magic __toString method returns a well formatted string
     * as specified in the DOT standard
     *
     * @covers phpDocumentor\GraphViz\Node::__toString
     *
     * @return void
     */
    public function testToString()
    {
        $this->fixture->setfontsize(12);
        $this->fixture->setfontname('Bitstream Vera Sans');
        $dot = <<<DOT
"name" [
label="label"
fontsize="12"
fontname="Bitstream Vera Sans"
]
DOT;
        $this->assertSame($dot, (string) $this->fixture);
    }
Ejemplo n.º 2
0
    /**
     * Tests whether the magic __toString method returns a well formatted string
     * as specified in the DOT standard when the label contains slashes.
     *
     * @covers phpDocumentor\GraphViz\Node::__toString
     */
    public function testToStringWithLabelContainingSlashes()
    {
        $this->fixture->setfontsize(12);
        $this->fixture->setfontname('Bitstream Vera Sans');
        $this->fixture->setLabel('\\phpDocumentor\\Descriptor\\ProjectDescriptor');
        $dot = <<<DOT
"name" [
label="\\\\phpDocumentor\\\\Descriptor\\\\ProjectDescriptor"
fontsize="12"
fontname="Bitstream Vera Sans"
]
DOT;
        $this->assertSame($dot, (string) $this->fixture);
    }