コード例 #1
0
 public function testAdImage()
 {
     $facebook = $this->getFacebook();
     $adAccountRepository = new \ReFUEL4\FacebookObject\Repositories\AdAccountRepository($facebook);
     $adAccounts = $adAccountRepository->all();
     $this->assertTrue(is_array($adAccounts));
     $adAccount = $adAccounts[0];
     $adImageRepository = new \ReFUEL4\FacebookObject\Repositories\AdImageRepository($facebook);
     $adImage = $adImageRepository->create($adAccount->id, realpath(dirname(__FILE__)) . '/media/sample.jpg');
     $this->assertNotEmpty($adImage->hash);
     $this->assertNotEmpty($adImage->id);
     $this->assertTrue($adImage->url !== null);
 }
コード例 #2
0
 public function testAdVideo()
 {
     $facebook = $this->getFacebook();
     $adAccountRepository = new \ReFUEL4\FacebookObject\Repositories\AdAccountRepository($facebook);
     $adAccounts = $adAccountRepository->all();
     $this->assertTrue(is_array($adAccounts));
     $adAccount = $adAccounts[0];
     $adVideoRepository = new \ReFUEL4\FacebookObject\Repositories\AdVideoRepository($facebook);
     $adVideos = $adVideoRepository->all($adAccount->id);
     $this->assertTrue(is_array($adVideos));
     $this->assertInstanceOf('\\ReFUEL4\\FacebookObject\\Objects\\AdVideo', $adVideos[0], 'object is AdVideo');
     $adVideo = $adVideoRepository->create($adAccount->id, realpath(dirname(__FILE__)) . '/media/sample.mp4');
     print $adVideo->id;
 }
コード例 #3
0
 public function testAdAccount()
 {
     $facebook = $this->getFacebook();
     $repository = new \ReFUEL4\FacebookObject\Repositories\AdAccountRepository($facebook);
     $adAccounts = $repository->all();
     $this->assertTrue(is_array($adAccounts));
     $adAccount = $adAccounts[0];
     $this->assertInstanceOf('\\ReFUEL4\\FacebookObject\\Objects\\AdAccount', $adAccount, 'object is AdAccount');
     $this->assertInstanceOf('DateTimeZone', $adAccount->getTimeZone(), 'Check Time Zone');
     $adImages = $adAccount->adimages;
     $this->assertTrue(is_array($adImages));
     $adImage = $adImages[0];
     $this->assertInstanceOf('\\ReFUEL4\\FacebookObject\\Objects\\AdImage', $adImage, 'object is AdImage');
     $this->assertNotEmpty($adImage->permalink_url, 'Permalink Exists');
     $adVideos = $adAccount->advideos;
     $this->assertTrue(is_array($adVideos));
     $adVideo = $adVideos[0];
     $this->assertInstanceOf('\\ReFUEL4\\FacebookObject\\Objects\\AdVideo', $adVideo, 'object is AdVideo');
 }