Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/magento/module-sales-rule/Test/Unit/Model/Rule/Condition/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/module-sales-rule/Test/Unit/Model/Rule/Condition/AddressTest.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\SalesRule\Test\Unit\Model\Rule\Condition;

use Magento\SalesRule\Model\Rule\Condition\Address;
use PHPUnit\Framework\TestCase;

/**
 * Test for address rule condition
 */
class AddressTest extends TestCase
{
    /**
     * @var Address
     */
    private $model;

    /**
     * @inheritDoc
     */
    protected function setUp(): void
    {
        parent::setUp();
        $context = $this->createMock(\Magento\Rule\Model\Condition\Context::class);
        $directoryCountry = $this->createMock(\Magento\Directory\Model\Config\Source\Country::class);
        $directoryAllregion = $this->createMock(\Magento\Directory\Model\Config\Source\Allregion::class);
        $shippingAllmethods = $this->createMock(\Magento\Shipping\Model\Config\Source\Allmethods::class);
        $paymentAllmethods = $this->createMock(\Magento\Payment\Model\Config\Source\Allmethods::class);
        $this->model = new Address(
            $context,
            $directoryCountry,
            $directoryAllregion,
            $shippingAllmethods,
            $paymentAllmethods
        );
    }

    /**
     * Test that all attributes are present in options list
     */
    public function testLoadAttributeOptions(): void
    {
        $attributes = [
            'base_subtotal_with_discount',
            'base_subtotal_total_incl_tax',
            'base_subtotal',
            'total_qty',
            'weight',
            'payment_method',
            'shipping_method',
            'postcode',
            'region',
            'region_id',
            'country_id',
        ];

        $this->model->loadAttributeOptions();
        $this->assertEquals($attributes, array_keys($this->model->getAttributeOption()));
    }
}

Spamworldpro Mini