예제 #1
0
 /**
  * Tests whether the toString provides a valid GraphViz attribute string.
  *
  * @return void
  */
 public function testToString()
 {
     $this->fixture = new Attribute('a', 'b');
     $this->assertSame('a="b"', (string) $this->fixture, 'Strings should be surrounded with quotes');
     $this->fixture->setValue('a"a');
     $this->assertSame('a="a\\"a"', (string) $this->fixture, 'Strings should be surrounded with quotes');
     $this->fixture->setKey('url');
     $this->assertSame('URL="a\\"a"', (string) $this->fixture, 'The key named URL must be uppercased');
     $this->fixture->setValue('<a>test</a>');
     $this->assertSame('URL=<a>test</a>', (string) $this->fixture, 'HTML strings should not be surrounded with quotes');
 }
 /**
  * Tests whether the isValueContainingSpecials function
  *
  * @covers \phpDocumentor\GraphViz\Attribute::isValueContainingSpecials
  *
  * @return void
  */
 public function testIsValueContainingSpecials()
 {
     $this->fixture->setValue('+ name : string\\l+ home_country : string\\l');
     $this->assertTrue($this->fixture->isValueContainingSpecials());
     $this->fixture->setValue('+ ship(): boolean');
     $this->assertFalse($this->fixture->isValueContainingSpecials());
 }