<commit_before><?php

namespace Xsolla\SDK\Tests\Protocol\Command;

use Xsolla\SDK\Protocol\Command\PayCash;

class PayCashTest extends CommandTest
{
    protected $signParams = array('v1', 'amount', 'currency', 'id');
    protected $signParamName = 'sign';

    public function setUp()
    {
        parent::setUp();
        $this->command = new PayCash($this->projectMock, $this->paymentsCashMock);
        $this->request = array(
            'id' => 'example_id',
            'amount' => 'example_amount',
            'v1' => 'example_v1',
            'v2' => 'example_v2',
            'v3' => 'example_v3',
            'currency' => 'example_currency',
            'datetime' => '20131212110000',
            'userAmount' => 'example_userAmount',
            'userCurrency' => 'example_userCurrency',
            'transferAmount' => 'example_transferAmount',
            'transferCurrency' => 'example_transferCurrency',
            'pid' => 'example_pid',
            'geotype' => 'example_geotype'
        );
        $this->queryBag->replace($this->request);
    }

    public function testCheckSign()
    {
        $request = array(
            'v1' => 'v1',
            'amount' => '123',
            'currency' => 'RUR',
            'id' => '456'
        );
        $this->checkSignTest($request);
    }

    /**
     * @dataProvider dryRunDataProvider
     */
    public function testProcess($dryRunQueryParameter, $expectedDryRun)
    {
        if (!is_null($dryRunQueryParameter)) {
            $this->queryBag->set('dry_run', $dryRunQueryParameter);
        }
        $this->paymentsCashMock->expects($this->once())
            ->method('pay')
            ->with(
                'example_id',
                'example_amount',
                'example_v1',
                'example_v2',
                'example_v3',
                'example_currency',
                new \DateTime('2013-12-12 11:00:00'),
                $expectedDryRun,
                'example_userAmount',
                'example_userCurrency',
                'example_transferAmount',
                'example_transferCurrency',
                'example_pid',
                'example_geotype'
            );
        $result = $this->command->process($this->requestMock);

        $this->assertEquals(PayCash::CODE_SUCCESS, $result['result']);
    }<commit_msg>add unsuccessful reuslt code exception message to PayCashTest::process<commit_after><?php

namespace Xsolla\SDK\Tests\Protocol\Command;

use Xsolla\SDK\Protocol\Command\PayCash;

class PayCashTest extends CommandTest
{
    protected $signParams = array('v1', 'amount', 'currency', 'id');
    protected $signParamName = 'sign';

    public function setUp()
    {
        parent::setUp();
        $this->command = new PayCash($this->projectMock, $this->paymentsCashMock);
        $this->request = array(
            'id' => 'example_id',
            'amount' => 'example_amount',
            'v1' => 'example_v1',
            'v2' => 'example_v2',
            'v3' => 'example_v3',
            'currency' => 'example_currency',
            'datetime' => '20131212110000',
            'userAmount' => 'example_userAmount',
            'userCurrency' => 'example_userCurrency',
            'transferAmount' => 'example_transferAmount',
            'transferCurrency' => 'example_transferCurrency',
            'pid' => 'example_pid',
            'geotype' => 'example_geotype'
        );
        $this->queryBag->replace($this->request);
    }

    public function testCheckSign()
    {
        $request = array(
            'v1' => 'v1',
            'amount' => '123',
            'currency' => 'RUR',
            'id' => '456'
        );
        $this->checkSignTest($request);
    }

    /**
     * @dataProvider dryRunDataProvider
     */
    public function testProcess($dryRunQueryParameter, $expectedDryRun)
    {
        if (!is_null($dryRunQueryParameter)) {
            $this->queryBag->set('dry_run', $dryRunQueryParameter);
        }
        $this->paymentsCashMock->expects($this->once())
            ->method('pay')
            ->with(
                'example_id',
                'example_amount',
                'example_v1',
                'example_v2',
                'example_v3',
                'example_currency',
                new \DateTime('2013-12-12 11:00:00'),
                $expectedDryRun,
                'example_userAmount',
                'example_userCurrency',
                'example_transferAmount',
                'example_transferCurrency',
                'example_pid',
                'example_geotype'
            );
        $result = $this->command->process($this->requestMock);

        $exceptionMessage = isset($result['description']) ? $result['description'] : '';
        $this->assertEquals(
            PayCash::CODE_SUCCESS,
            $result['result'],
            $exceptionMessage
        );
    }
{'fraction_non_alphanumeric': 0.1439625330889839, 'fraction_numerical': 0.01873345550804317, 'mean_word_length': 1.8860164512338424, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 75, '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': '808090', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1378, 'n_words': 216}