Пример #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');
 }