diff --git a/templates/ProductCategoryVariants/index.php b/templates/ProductCategoryVariants/index.php index 1ce7013..29fb234 100644 --- a/templates/ProductCategoryVariants/index.php +++ b/templates/ProductCategoryVariants/index.php @@ -1,8 +1,9 @@ $productCategoryVariants + * @var iterable<\App\Model\Entity\ProductCategoryVariant>|iterable<\Cake\ORM\Entity> $productCategoryVariants */ + ?>
Html->link(__('New Product Category Variant'), ['action' => 'add'], ['class' => 'button float-right']) ?> @@ -15,7 +16,6 @@ Paginator->sort('name') ?> Paginator->sort('product_category_id') ?> Paginator->sort('product_id') ?> - Paginator->sort('attribute_type_id') ?> Paginator->sort('enabled') ?> @@ -23,12 +23,12 @@ + id) ?> name) ?> hasValue('product_category') ? $this->Html->link($productCategoryVariant->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productCategoryVariant->product_category->id]) : '' ?> hasValue('product') ? $this->Html->link($productCategoryVariant->product->name, ['controller' => 'Products', 'action' => 'view', $productCategoryVariant->product->id]) : '' ?> - Number->format($productCategoryVariant->attribute_type_id) ?> enabled) ?> diff --git a/templates/ProductCategoryVariants/view.php b/templates/ProductCategoryVariants/view.php index 004dcee..9f8ebb5 100644 --- a/templates/ProductCategoryVariants/view.php +++ b/templates/ProductCategoryVariants/view.php @@ -34,10 +34,6 @@ hasValue('product') ? $this->Html->link($productCategoryVariant->product->name, ['controller' => 'Products', 'action' => 'view', $productCategoryVariant->product->id]) : '' ?> - - - Number->format($productCategoryVariant->attribute_type_id) ?> - enabled ? __('Yes') : __('No'); ?> diff --git a/tests/TestCase/Controller/ProductCategoryVariantsControllerTest.php b/tests/TestCase/Controller/ProductCategoryVariantsControllerTest.php index 5974889..b06b7fe 100644 --- a/tests/TestCase/Controller/ProductCategoryVariantsControllerTest.php +++ b/tests/TestCase/Controller/ProductCategoryVariantsControllerTest.php @@ -3,9 +3,9 @@ declare(strict_types=1); namespace CakeProducts\Test\TestCase\Controller; +use Cake\ORM\Table; use CakeProducts\Controller\ProductCategoryVariantsController; -use Cake\TestSuite\IntegrationTestTrait; -use Cake\TestSuite\TestCase; +use CakeProducts\Model\Table\ProductCategoryAttributesTable; use CakeProducts\Model\Table\ProductCategoryVariantOptionsTable; use CakeProducts\Model\Table\ProductCategoryVariantsTable; use PHPUnit\Exception; @@ -51,8 +51,11 @@ class ProductCategoryVariantsControllerTest extends BaseControllerTest protected function setUp(): void { parent::setUp(); - $this->ProductCategoryVariants = $this->getTableLocator()->get('ProductCategoryVariants'); - $this->ProductCategoryVariantOptions = $this->getTableLocator()->get('ProductCategoryVariantOptions'); + $config = $this->getTableLocator()->exists('ProductCategoryVariants') ? [] : ['className' => ProductCategoryVariantsTable::class]; + $this->ProductCategoryVariants = $this->getTableLocator()->get('ProductCategoryVariants', $config); + + $config = $this->getTableLocator()->exists('ProductCategoryVariantOptions') ? [] : ['className' => ProductCategoryVariantOptionsTable::class]; + $this->ProductCategoryVariantOptions = $this->getTableLocator()->get('ProductCategoryVariantOptions', $config); } /**