<commit_before><?php

require("../RiotAPI.php");
use \RiotAPI\RiotAPI;
    
        
class tests extends PHPUnit_Framework_TestCase
{
    private $api;
    
    public function setUp()
    {
        $this->api = new RiotAPI("euw");
    }

    public function testGetValidRegions()
    {
        $this->assertInstanceOf('array', $this->api->getValidRegions());
    }
    
    public function testRegionIsSet()
    {
        $this->assertTrue($this->api->regionIsSet());
    }
    
    public function testBuildUrl()
    {
        $this->assertNotEmpty($this->api->buildURL(RiotAPI::STATIC_SERVER_URL . 'versions'));
    }

    public function testExecuteCallToIncorrectUrl()
    {
        $this->setExpectedException('CurlException');
        $this->api->executeCall('http://nonexisiting.example.com/');
    }
    
    public function testExecuteCallWithoutValidApiKey()
    {
        $this->setExpectedException('ApiException');
        $this->api->executeCall($this->api->buildURL(RiotAPI::STATIC_SERVER_URL . 'versions'));
    }
}<commit_msg>Update tests.php<commit_after><?php

require("../RiotAPI.php");

use \RiotAPI\RiotAPI;
use \RiotAPI\Exceptions\CurlException;
use \RiotAPI\Exceptions\ApiException;
        
class tests extends PHPUnit_Framework_TestCase
{
    private $api;
    
    public function setUp()
    {
        $this->api = new RiotAPI("euw");
        $this->assertNotNull($this->api);
    }

    public function testRegionIsSet()
    {
        $this->assertTrue($this->api->regionIsSet());
    }
    
    public function testBuildUrl()
    {
        $this->assertNotEmpty($this->api->buildURL(RiotAPI::STATIC_SERVER_URL . 'versions'));
    }

    public function testExecuteCallToIncorrectUrl()
    {
        $this->setExpectedException('\RiotAPI\Exceptions\CurlException');
        $this->api->executeCall('http://nonexisiting.example.com/');
    }
    
    public function testExecuteCallWithoutValidApiKey()
    {
        $this->setExpectedException('\RiotAPI\Exceptions\ApiException');
        $this->api->executeCall($this->api->buildURL(RiotAPI::STATIC_SERVER_URL . 'versions'));
    }
}
{'fraction_non_alphanumeric': 0.1466414380321665, 'fraction_numerical': 0.0, 'mean_word_length': 3.0595009596928984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1626604', 'n_tokens_mistral': 651, 'n_tokens_neox': 649, 'n_words': 83}