Пример #1
0
 /**
  * Use yuml.me to generate an image from yuml.
  *
  * @param string $dsl_text
  *
  * @return string The url of the generated image.
  */
 public function getGraphUrl($dsl_text)
 {
     $curl = new Curl(self::YUML_POST_URL);
     $curl->setPosts(array('dsl_text' => $dsl_text));
     $return = $curl->getResponse();
     return self::YUML_REDIRECT_URL . $return;
 }
Пример #2
0
 /**
  * @covers \Onurb\Bundle\YumlBundle\Curl\Curl
  */
 public function testResponseWithPostData()
 {
     $testUrl = 'http://yuml.me/diagram/plain/class';
     $curl = new Curl($testUrl);
     $posts = array('dsl_text' => '[Simple.Entity|+a;b;c]');
     $curl->setPosts($posts);
     $response = $curl->getResponse();
     $this->assertSame('15a98c92.png', $response);
 }