<commit_before><?php

namespace Zimbra\Account\Tests\Request;

use Zimbra\Account\Tests\ZimbraAccountApiTestCase;
use Zimbra\Account\Request\GenerateScratchCodes;

/**
 * Testcase class for GenerateScratchCodes.
 */
class GenerateScratchCodesTest extends ZimbraAccountApiTestCase
{
    public function testGetAllLocalesRequest()
    {
        $req = new GenerateScratchCodes;
        $this->assertInstanceOf('Zimbra\Account\Request\Base', $req);

        $xml = '<?xml version="1.0"?>' . "\n"
            . '<GenerateScratchCodesRequest />';
        $this->assertXmlStringEqualsXmlString($xml, (string) $req);

        $array = [
            'GenerateScratchCodesRequest' => [
                '_jsns' => 'urn:zimbraAccount',
            ],
        ];
        $this->assertEquals($array, $req->toArray());
    }

    public function testGetAllLocalesApi()
    {
        $this->api->generateScratchCodes();

        $client = $this->api->getClient();
        $req = $client->lastRequest();
        $xml = '<?xml version="1.0"?>' . "\n"
            . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:zimbra" xmlns:urn1="urn:zimbraAccount">'
                . '<env:Body>'
                    . '<urn1:GenerateScratchCodesRequest />'
                . '</env:Body>'
            . '</env:Envelope>';
        $this->assertXmlStringEqualsXmlString($xml, (string) $req);<commit_msg>Fix typo<commit_after><?php

namespace Zimbra\Account\Tests\Request;

use Zimbra\Account\Tests\ZimbraAccountApiTestCase;
use Zimbra\Account\Request\GenerateScratchCodes;

/**
 * Testcase class for GenerateScratchCodes.
 */
class GenerateScratchCodesTest extends ZimbraAccountApiTestCase
{
    public function testGenerateScratchCodesRequest()
    {
        $req = new GenerateScratchCodes;
        $this->assertInstanceOf('Zimbra\Account\Request\Base', $req);

        $xml = '<?xml version="1.0"?>' . "\n"
            . '<GenerateScratchCodesRequest />';
        $this->assertXmlStringEqualsXmlString($xml, (string) $req);

        $array = [
            'GenerateScratchCodesRequest' => [
                '_jsns' => 'urn:zimbraAccount',
            ],
        ];
        $this->assertEquals($array, $req->toArray());
    }

    public function testGenerateScratchCodesApi()
    {
        $this->api->generateScratchCodes();

        $client = $this->api->getClient();
        $req = $client->lastRequest();
        $xml = '<?xml version="1.0"?>' . "\n"
            . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:zimbra" xmlns:urn1="urn:zimbraAccount">'
                . '<env:Body>'
                    . '<urn1:GenerateScratchCodesRequest />'
                . '</env:Body>'
            . '</env:Envelope>';
        $this->assertXmlStringEqualsXmlString($xml, (string) $req);
{'fraction_non_alphanumeric': 0.1594048884165781, 'fraction_numerical': 0.009210060219624512, 'mean_word_length': 2.6112531969309463, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 4, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 18}, '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': '7486177', 'n_tokens_mistral': 893, 'n_tokens_neox': 882, 'n_words': 120}