<commit_before><?php
namespace Payum\OmnipayBridge\Tests\Functional;

use Omnipay\Dummy\Gateway;

use Payum\OmnipayBridge\OnsitePaymentFactory;
use Payum\Core\Request\GetBinaryStatus;
use Payum\Core\Request\Capture;

class PaymentTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     */
    public function shouldFinishSuccessfully()
    {
        $payment = OnsitePaymentFactory::create(new Gateway());

        $date = new \DateTime('now + 2 year');

        $captureRequest = new Capture(array(
            'amount' => '1000.00',
            'card' => array(
                'number' => '4242424242424242', // must be authorized
                'cvv' => 123,
                'expiryMonth' => 6,
                'expiryYear' => $date->format('y'),
                'firstName' => 'foo',
                'lastName' => 'bar',
            )
        ));

        $payment->execute($captureRequest);

        $statusRequest = new GetBinaryStatus($captureRequest->getModel());
        $payment->execute($statusRequest);

        $this->assertTrue($statusRequest->isSuccess());
    }

    /**
     * @test
     */
    public function shouldFinishWithFailed()
    {
        $payment = OnsitePaymentFactory::create(new Gateway());

        $date = new \DateTime('now + 2 year');

        $captureRequest = new Capture(array(
            'amount' => '1000.00',
            'card' => array(
                'number' => '4111111111111111', //must be declined,
                'cvv' => 123,
                'expiryMonth' => 6,
                'expiryYear' => $date->format('y'),
                'firstName' => 'foo',
                'lastName' => 'bar',
            )
        ));

        $payment->execute($captureRequest);

        $statusRequest = new GetBinaryStatus($captureRequest->getModel());
        $payment->execute($statusRequest);

        $this->assertTrue($statusRequest->isFailed());<commit_msg>fix tests.<commit_after><?php
namespace Payum\OmnipayBridge\Tests\Functional;

use Omnipay\Dummy\Gateway;

use Payum\OmnipayBridge\OnsitePaymentFactory;
use Payum\Core\Request\GetBinaryStatus;
use Payum\Core\Request\Capture;

class PaymentTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     */
    public function shouldFinishSuccessfully()
    {
        $payment = OnsitePaymentFactory::create(new Gateway());

        $date = new \DateTime('now + 2 year');

        $capture = new Capture(array(
            'amount' => '1000.00',
            'card' => array(
                'number' => '4242424242424242', // must be authorized
                'cvv' => 123,
                'expiryMonth' => 6,
                'expiryYear' => $date->format('y'),
                'firstName' => 'foo',
                'lastName' => 'bar',
            )
        ));

        $payment->execute($capture);

        $statusRequest = new GetBinaryStatus($capture->getModel());
        $payment->execute($statusRequest);

        $this->assertTrue($statusRequest->isSuccess());
    }

    /**
     * @test
     */
    public function shouldFinishWithFailed()
    {
        $payment = OnsitePaymentFactory::create(new Gateway());

        $date = new \DateTime('now + 2 year');

        $capture = new Capture(array(
            'amount' => '1000.00',
            'card' => array(
                'number' => '4111111111111111', //must be declined,
                'cvv' => 123,
                'expiryMonth' => 6,
                'expiryYear' => $date->format('y'),
                'firstName' => 'foo',
                'lastName' => 'bar',
            )
        ));

        $payment->execute($capture);

        $statusRequest = new GetBinaryStatus($capture->getModel());
        $payment->execute($statusRequest);

        $this->assertTrue($statusRequest->isFailed());
{'fraction_non_alphanumeric': 0.15093840867036742, 'fraction_numerical': 0.028548770816812053, 'mean_word_length': 2.0103420843277644, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '2208302', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1043, 'n_words': 190}