/**
  * 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;
 }
Esempio n. 2
0
 /**
  * @covers \Onurb\Bundle\YumlBundle\Curl\Curl
  */
 public function testDowloadFile()
 {
     $fileUrl = 'http://yuml.me/15a98c92.png';
     $fileName = 'test.png';
     $this->assertFalse(file_exists($fileName));
     $curl = new Curl($fileUrl);
     $curl->setOutput($fileName);
     $curl->getResponse();
     $this->assertTrue(file_exists($fileName));
     if (file_exists($fileName)) {
         unlink($fileName);
     }
 }