<commit_before><?php
use PHPUnit\Framework\TestCase;

class CronofyTest extends TestCase
{

    public function testAuthorizationUrl()
    {
        $redirect_uri = "http://yoursite.dev/oauth2/callback";

        $cronofy = new Cronofy(array("client_id" => "clientId"));
        $params = array(
            'redirect_uri' => $redirect_uri,
            'scope' => array('read_account','list_calendars')
        );
        $auth = $cronofy->getAuthorizationURL($params);

        $this->assertEquals("https://app.cronofy.com/oauth/authorize?response_type=code&client_id=clientId&redirect_uri=http%3A%2F%2Fyoursite.dev%2Foauth2%2Fcallback&scope=read_account list_calendars", $auth);
    }

    public function testGetAccount()
    {
        $http = $this->createMock('HttpRequest');
        $http->expects($this->once())
            ->method('http_get')
            ->with(
                $this->equalTo('https://api.cronofy.com/v1/account'),<commit_msg>update test testAuthorizationUrl<commit_after><?php
use PHPUnit\Framework\TestCase;

class CronofyTest extends TestCase
{

    public function testAuthorizationUrl()
    {
        $redirect_uri = "http://yoursite.dev/oauth2/callback";

        $cronofy = new Cronofy(array("client_id" => "clientId"));
        $params = array(
            'redirect_uri' => $redirect_uri,
            'scope' => array('read_account','list_calendars')
        );
        $auth = $cronofy->getAuthorizationURL($params);

        $this->assertEquals("https://app.cronofy.com/oauth/authorize?response_type=code&client_id=clientId&redirect_uri=http%3A%2F%2Fyoursite.dev%2Foauth2%2Fcallback&scope=read_account%20list_calendars", $auth);
    }

    public function testGetAccount()
    {
        $http = $this->createMock('HttpRequest');
        $http->expects($this->once())
            ->method('http_get')
            ->with(
                $this->equalTo('https://api.cronofy.com/v1/account'),
{'fraction_non_alphanumeric': 0.15204981837052414, 'fraction_numerical': 0.00934094447327452, 'mean_word_length': 3.1913043478260867, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 4, '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': '5135274', 'n_tokens_mistral': 630, 'n_tokens_neox': 621, 'n_words': 72}