HEX
Server: Apache
System: Linux webm019.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: petsclubcc (68997)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/petsclubcc/magento/vendor/magento/module-payment/Test/Unit/Model/Method/CcTest.php
<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Payment\Test\Unit\Model\Method;

use Magento\Framework\DataObject;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Payment\Model\Method\Cc;
use Magento\Quote\Api\Data\PaymentInterface;
use Magento\Quote\Model\Quote\Payment;

class CcTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Cc
     */
    private $ccModel;

    public function setUp()
    {
        $objectManager = new ObjectManager($this);
        $this->ccModel = $objectManager->getObject(Cc::class);
    }
    
    public function testAssignData()
    {
        $additionalData = [
            'cc_type' => 'VI',
            'cc_owner' => 'Bruce',
            'cc_number' => '41111111111111',
            'cc_cid' => '42',
            'cc_exp_month' => '02',
            'cc_exp_year' => '30',
            'cc_ss_issue' => '9',
            'cc_ss_start_month' => '01',
            'cc_ss_start_year' => '30'
        ];

        $inputData = new DataObject(
            [
                PaymentInterface::KEY_ADDITIONAL_DATA => $additionalData
            ]
        );

        $payment = $this->getMockBuilder(Payment::class)
            ->disableOriginalConstructor()
            ->getMock();

        $expectedData = [
            'cc_type' => 'VI',
            'cc_owner' => 'Bruce',
            'cc_last_4' => '1111',
            'cc_number' => '41111111111111',
            'cc_cid' => '42',
            'cc_exp_month' => '02',
            'cc_exp_year' => '30',
            'cc_ss_issue' => '9',
            'cc_ss_start_month' => '01',
            'cc_ss_start_year' => '30'
        ];

        $payment->expects(static::once())
            ->method('addData')
            ->with(
                $expectedData
            );

        $this->ccModel->setInfoInstance($payment);
        $this->ccModel->assignData($inputData);
    }
}