PHP Classes

File: tests/InstagramTest.php

Recommend this page to a friend!
  Classes of Haridarshan Gorana   PHP Instagram API   tests/InstagramTest.php   Download  
File: tests/InstagramTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHP Instagram API
Send requests to Instagram API using OAuth tokens
Author: By
Last change:
Date: 8 years ago
Size: 835 bytes
 

Contents

Class file image Download
<?php
namespace Haridarshan\Instagram\Test;

use
Haridarshan\Instagram\Instagram;

class
InstagramTest extends \PHPUnit_Framework_TestCase
{
    protected
$instagram;

    protected function
setup()
    {
       
$config = [
           
'ClientId' => '{CLIENT_ID}',
           
'ClientSecret' => '{CLIENT_SECRET}',
           
'Callback' => CALLBACK_URL,
        ];

       
$this->instagram = new Instagram($config);
    }

    public function
testUrl()
    {
       
$scope = [
           
'basic',
        ];

       
$url = $this->instagram->getLoginUrl(['scope' => $scope]);
       
$state = $this->instagram->getState();

       
$this->assertEquals('https://api.instagram.com/oauth/authorize?client_id={CLIENT_ID}&redirect_uri=' . urlencode(CALLBACK_URL) . '&response_type=code&state=' . $state . '&scope=basic', $url);
    }
}