Example #1
0
 /**
  * @expectedException \UnexpectedValueException
  */
 public function testGenerateHtmlUnsupportedObject()
 {
     $object = new TestPublishObject(new \stdClass());
     $this->publisher->generateHtml($object);
 }
Example #2
0
if (!($loader = @(include __DIR__ . '/../vendor/autoload.php'))) {
    die('You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . 'php composer.phar install' . PHP_EOL);
}
// Construct a new Open Graph object
$website = new Website();
// Set some basic properties
$website->url = "http://www.fusonic.net";
$website->title = "Fusonic - Intranet & Mobile Applications from Austria";
$website->description = "Creators of the awesome fusonic-opengraph library.";
$website->siteName = "Fusonic";
$website->locale = "en_GB";
// Attach an image
$image = new Image("http://www.fusonic.net/en/assets/images/logo.png");
$image->width = 140;
$image->height = 41;
$image->type = "image/png";
$website->images[] = $image;
// Attach a video
$video = new Video("http://www.fusonic.net/en/we-dont-have-no-video.mp4");
$video->width = 1920;
$video->height = 1080;
$video->type = "video/mp4";
$website->videos[] = $video;
// Attach an audio
$audio = new Audio("http://www.fusonic.net/en/we-dont-have-no-audio.mp3");
$audio->type = "audio/mp3";
$website->audios[] = $audio;
// Create Publisher object and echo HTML code
$publisher = new Publisher();
$publisher->doctype = Publisher::DOCTYPE_XHTML;
echo $publisher->generateHtml($website);