<commit_before><?php

namespace Plivo\Tests\Resources;


use Plivo\Http\PlivoRequest;
use Plivo\Http\PlivoResponse;
use Plivo\Tests\BaseTestCase;

/**
 * Class SubAccountTest
 * @package Plivo\Tests\Resources
 */
class SubAccountTest extends BaseTestCase
{
    function testSubAccountCreate()
    {
        $subAccountAuthId = "<PASSWORD>";
        $request = new PlivoRequest(
            'POST',
            'Account/MAXXXXXXXXXXXXXXXXXX/Subaccount/',
            [
                'name' => "name",
                'enabled' => true,
            ]);
        $body = file_get_contents(__DIR__ . '/../Mocks/subaccountCreateResponse.json');

        $this->mock(new PlivoResponse($request,200, $body));

        $actual = $this->client->subAccounts->create('name', true);

        $this->assertRequest($request);

        self::assertNotNull($actual);

        self::assertEquals($actual->api_id, "97c8d1de-3f08-11e7-b6f4-061564b78b75");
        self::assertEquals($actual->auth_id, "SANDLHYZBIZMU4ZDEXNM");
        self::assertEquals($actual->auth_token, "<KEY>");
        self::assertEquals($actual->message, "created");
    }

    function testSubAccountList()
    {
        $request = new PlivoRequest(
            'GET',
            'Account/MAXXXXXXXXXXXXXXXXXX/Subaccount/',
            []);
        $body = file_get_contents(__DIR__ . '/../Mocks/subaccountListResponse.json');

        $this->mock(new PlivoResponse($request,200, $body));<commit_msg>SUP-83 :: fixed subaccount create test case assertion conditions<commit_after><?php

namespace Plivo\Tests\Resources;


use Plivo\Http\PlivoRequest;
use Plivo\Http\PlivoResponse;
use Plivo\Tests\BaseTestCase;

/**
 * Class SubAccountTest
 * @package Plivo\Tests\Resources
 */
class SubAccountTest extends BaseTestCase
{
    function testSubAccountCreate()
    {
        $subAccountAuthId = "<PASSWORD>";
        $request = new PlivoRequest(
            'POST',
            'Account/MAXXXXXXXXXXXXXXXXXX/Subaccount/',
            [
                'name' => "name",
                'enabled' => true,
            ]);
        $body = file_get_contents(__DIR__ . '/../Mocks/subaccountCreateResponse.json');

        $this->mock(new PlivoResponse($request,200, $body));

        $actual = $this->client->subAccounts->create('name', true);

        $this->assertRequest($request);

        self::assertNotNull($actual);

        self::assertEquals($actual->apiId, "97c8d1de-3f08-11e7-b6f4-061564b78b75");
        self::assertEquals($actual->authId, "S<PASSWORD>");
        self::assertEquals($actual->authToken, "<KEY>");
        self::assertEquals($actual->message, "created");
    }

    function testSubAccountList()
    {
        $request = new PlivoRequest(
            'GET',
            'Account/MAXXXXXXXXXXXXXXXXXX/Subaccount/',
            []);
        $body = file_get_contents(__DIR__ . '/../Mocks/subaccountListResponse.json');

        $this->mock(new PlivoResponse($request,200, $body));
{'fraction_non_alphanumeric': 0.1478849407783418, 'fraction_numerical': 0.01996615905245347, 'mean_word_length': 2.741772151898734, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '651239', 'n_tokens_mistral': 917, 'n_tokens_neox': 872, 'n_words': 130}