Example #1
0
 /**
  * @test
  */
 public function testSetGet()
 {
     $token = new \Tmdb\RequestToken();
     $token->setToken(self::REQUEST_TOKEN);
     $token->setExpiresAt('2012-02-09 19:50:25 UTC');
     $token->setSuccess(true);
     $this->assertEquals(self::REQUEST_TOKEN, $token->getToken());
     $this->assertInstanceOf('DateTime', $token->getExpiresAt());
     $this->assertEquals(true, $token->getSuccess());
 }
Example #2
0
<?php

/**
 * This file is part of the Tmdb PHP API created by Michael Roterman.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package Tmdb
 * @author Michael Roterman <*****@*****.**>
 * @copyright (c) 2013, Michael Roterman
 * @version 0.0.1
 */
require_once '../../../vendor/autoload.php';
require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$requestToken = new \Tmdb\RequestToken(TMDB_REQUEST_TOKEN);
$client->getAuthenticationApi()->authenticateRequestToken($requestToken->getToken());
Example #3
0
<?php

/**
 * This file is part of the Tmdb PHP API created by Michael Roterman.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package Tmdb
 * @author Michael Roterman <*****@*****.**>
 * @copyright (c) 2013, Michael Roterman
 * @version 0.0.1
 */
require_once '../../../vendor/autoload.php';
require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$requestToken = new \Tmdb\RequestToken(TMDB_REQUEST_TOKEN);
$sessionToken = $client->getAuthenticationApi()->getNewSession($requestToken->getToken());
var_dump($sessionToken);