for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is a part of nekland youtube api package
*
* (c) Nekland <[email protected]>
* For the full license, take a look to the LICENSE file
* on the root directory of this project
*/
namespace Nekland\Tests\Http\Auth;
use Nekland\YoutubeApi\Http\Auth\PublicApiAccessAuth;
class PublicApiAccessAuthTest extends \PHPUnit_Framework_TestCase
{
* @test
public function shouldBeConstructWithoutAnyParameter()
$auth = new PublicApiAccessAuth();
$this->assertInstanceOf('Nekland\\YoutubeApi\\Http\\Auth\\PublicApiAccessAuth', $auth);
}
public function shouldAddParameterToUrl()
$auth->setOptions(['key' => 'SOME_YOUTUBE_API_KEY']);
$request = $this->getMockBuilder('Guzzle\Http\Message\Request')->disableOriginalConstructor()->getMock();
$request
->expects($this->once())
->method('getUrl')
->willReturn('http://fake.com')
;
->method('setUrl')
->with($this->equalTo('http://fake.com?key=SOME_YOUTUBE_API_KEY'))
$auth->auth($request);