<commit_before><?php
class YelpTest extends PHPUnit_Framework_TestCase
{
    /**
     * Yelp App ID and Secret must be placed in phpunit.xml for tests to work locally.
     */
    protected $client_id;
    protected $client_secret;

    protected function setUp() {
        $this->client_id = $_ENV["client_id"];
        $this->client_secret = $_ENV["client_secret"];

        var_dump($_ENV);
    }

    /**
     * Asserts returned object has 'access_token', 'token_type', and 'expires_in' attributes
     */
    public function testAuth(){
        $stack = [];
        $result = \TVW\Yelp::bearerRequest($this->client_id, $this->client_secret);
        $this->assertObjectHasAttribute('access_token', $result);
        $this->assertObjectHasAttribute('token_type', $result);
        $this->assertObjectHasAttribute('expires_in', $result);

        $stack["client_token"] =  $result->access_token;
        return $stack;
    }

    /**
     * Exception generated by missing id and secret parameters<commit_msg>Testing Travis ENV vars.<commit_after><?php
class YelpTest extends PHPUnit_Framework_TestCase
{
    /**
     * Yelp App ID and Secret must be placed in phpunit.xml for tests to work locally.
     */
    protected $client_id;
    protected $client_secret;

    protected function setUp() {
        $this->client_id = $_ENV["client_id"];
        $this->client_secret = $_ENV["client_secret"];
print "***";
        var_dump($_ENV);
        print "***\n";
    }

    /**
     * Asserts returned object has 'access_token', 'token_type', and 'expires_in' attributes
     */
    public function testAuth(){
        $stack = [];
        $result = \TVW\Yelp::bearerRequest($this->client_id, $this->client_secret);
        $this->assertObjectHasAttribute('access_token', $result);
        $this->assertObjectHasAttribute('token_type', $result);
        $this->assertObjectHasAttribute('expires_in', $result);

        $stack["client_token"] =  $result->access_token;
        return $stack;
    }

    /**
     * Exception generated by missing id and secret parameters
{'fraction_non_alphanumeric': 0.13346228239845262, 'fraction_numerical': 0.0, 'mean_word_length': 3.0489236790606653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6620434', 'n_tokens_mistral': 608, 'n_tokens_neox': 591, 'n_words': 137}