/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Tax/Model/TaxRateCollectionTest.php
44 строки
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2014 Adobe * All Rights Reserved. */ namespace Magento\Tax\Model; use Magento\TestFramework\Helper\Bootstrap; class TaxRateCollectionTest extends \PHPUnit\Framework\TestCase { public function testCreateTaxRateCollectionItem() { /** @var \Magento\Tax\Model\ResourceModel\Calculation\Rate\Collection $collection */ $collection = Bootstrap::getObjectManager()->get( \Magento\Tax\Model\ResourceModel\Calculation\Rate\Collection::class ); $dbTaxRatesQty = $collection->count(); if (($dbTaxRatesQty == 0) || ($collection->getFirstItem()->getId() != 1)) { $this->fail("Preconditions failed."); } /** @var \Magento\Tax\Model\TaxRateCollection $taxRatesCollection */ $taxRatesCollection = Bootstrap::getObjectManager() ->create(\Magento\Tax\Model\TaxRateCollection::class); $collectionTaxRatesQty = $taxRatesCollection->count(); $this->assertEquals($dbTaxRatesQty, $collectionTaxRatesQty, 'Tax rates quantity is invalid.'); $taxRate = $taxRatesCollection->getFirstItem()->getData(); $expectedTaxRateData = [ 'code' => 'US-CA-*-Rate 1', 'tax_calculation_rate_id' => '1', 'rate' => 8.25, 'region_name' => 'CA', 'tax_country_id' => 'US', 'tax_postcode' => '*', 'tax_region_id' => '12', 'titles' => [], 'zip_is_range' => null, 'zip_from' => null, 'zip_to' => null, ]; $this->assertEquals($expectedTaxRateData, $taxRate, 'Tax rate data is invalid.'); } }