<NME> TwitterOAuthTest.php
<BEF> <?php

/**
 * WARNING: Running tests will post and delete through the actual Twitter account when updating or saving VCR cassettes.
 */

declare(strict_types=1);

namespace Abraham\TwitterOAuth\Test;

use PHPUnit\Framework\TestCase;
use Abraham\TwitterOAuth\TwitterOAuth;
define('ACCESS_TOKEN', getenv('TEST_ACCESS_TOKEN'));
define('ACCESS_TOKEN_SECRET', getenv('TEST_ACCESS_TOKEN_SECRET'));
define('OAUTH_CALLBACK', getenv('TEST_OAUTH_CALLBACK'));

class TwitterTest extends \PHPUnit_Framework_TestCase {

            CONSUMER_KEY,
            CONSUMER_SECRET,
            ACCESS_TOKEN,
            ACCESS_TOKEN_SECRET,
        );
        $this->userId = explode('-', ACCESS_TOKEN)[0];
    }

    /**
     * @vcr testGetAccountVerifyCredentials.json
     */
    public function testGetAccountVerifyCredentials()
    {
        $user = $this->twitter->get('account/verify_credentials', [
            'include_entities' => false,
            'include_email' => true,
        ]);
        $this->assertEquals(200, $this->twitter->getLastHttpCode());
        $this->assertObjectHasAttribute('email', $user);
    }
}
        $this->assertEquals(200, $this->twitter->lastHttpCode());
    }

    public function testGetStatusesMentionsTimeline() {
        $result = $this->twitter->get('statuses/mentions_timeline');
        $this->assertEquals(200, $this->twitter->lastHttpCode());

<MSG> Added proxy support and tests

<DFF> @@ -13,6 +13,9 @@ define('CONSUMER_SECRET', getenv('TEST_CONSUMER_SECRET'));
 define('ACCESS_TOKEN', getenv('TEST_ACCESS_TOKEN'));
 define('ACCESS_TOKEN_SECRET', getenv('TEST_ACCESS_TOKEN_SECRET'));
 define('OAUTH_CALLBACK', getenv('TEST_OAUTH_CALLBACK'));
+define('PROXY', getenv('TEST_CURLOPT_PROXY'));
+define('PROXYUSERPWD', getenv('TEST_CURLOPT_PROXYUSERPWD'));
+define('PROXYPORT', getenv('TEST_CURLOPT_PROXYPORT'));
 
 class TwitterTest extends \PHPUnit_Framework_TestCase {
 
@@ -69,6 +72,19 @@ class TwitterTest extends \PHPUnit_Framework_TestCase {
         $this->assertEquals(200, $this->twitter->lastHttpCode());
     }
 
+    public function testSetProxy() {
+        $this->twitter->setProxy(array(
+            'CURLOPT_PROXY' => PROXY,
+            'CURLOPT_PROXYUSERPWD' => PROXYUSERPWD,
+            'CURLOPT_PROXYPORT' => PROXYPORT,
+        ));
+        $this->twitter->setConnectionTimeout(25);
+        $this->twitter->setTimeout(25);
+        $result = $this->twitter->get('account/verify_credentials');
+        $this->assertEquals(200, $this->twitter->lastHttpCode());
+        $this->assertObjectHasAttribute('id', $result);
+    }
+
     public function testGetStatusesMentionsTimeline() {
         $result = $this->twitter->get('statuses/mentions_timeline');
         $this->assertEquals(200, $this->twitter->lastHttpCode());

{'addition_count': 16, 'commit_subject': 'Added proxy support and tests', 'deletion_count': 0, 'file_extension': '.php', 'lang': 'php', 'license': 'mit', 'repo_name': 'abraham/twitteroauth'}