Skip to content

Commit

Permalink
Getting green
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 25, 2014
1 parent 401550b commit b1fdc7d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
1 change: 0 additions & 1 deletion test/Tmdb/Tests/Api/AccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class AccountTest extends TestCase
{
/**
* @test
* @expectedException Tmdb\Exception\NotImplementedException
*/
public function shouldGetAccount()
{
Expand Down
2 changes: 0 additions & 2 deletions test/Tmdb/Tests/Api/AuthenticationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public function shouldGetNewToken()

/**
* @test
* @expectedException Tmdb\Exception\NotImplementedException
*/
public function shouldGetNewSession()
{
Expand All @@ -35,7 +34,6 @@ public function shouldGetNewSession()

/**
* @test
* @expectedException Tmdb\Exception\NotImplementedException
*/
public function shouldGetNewGuestSession()
{
Expand Down
40 changes: 40 additions & 0 deletions test/Tmdb/Tests/HttpClient/Plugin/SessionTokenPluginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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 <[email protected]>
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
namespace Tmdb\Tests\HttpClient\Plugin;

use Guzzle\Common\Event;
use Guzzle\Http\Message\Request;
use Tmdb\HttpClient\Plugin\SessionTokenPlugin;
use Tmdb\SessionToken;
use Tmdb\Tests\TestCase;

class SessionTokenPluginTest extends TestCase
{
/**
* @test
*/
public function shouldAddToken()
{
$token = new SessionToken('abcdef');
$request = new Request('GET', '/');

$event = new Event();
$event['request'] = $request;

$plugin = new SessionTokenPlugin($token);

$plugin->onBeforeSend($event);

$this->assertEquals('/?session_id=abcdef', $event['request']->getUrl());
}
}

0 comments on commit b1fdc7d

Please sign in to comment.