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
*/
+
?>
= $this->Html->link(__('New Product Category Variant'), ['action' => 'add'], ['class' => 'button float-right']) ?>
@@ -15,7 +16,6 @@
= $this->Paginator->sort('name') ?> |
= $this->Paginator->sort('product_category_id') ?> |
= $this->Paginator->sort('product_id') ?> |
- = $this->Paginator->sort('attribute_type_id') ?> |
= $this->Paginator->sort('enabled') ?> |
= 'Options' ?> |
= __('Actions') ?> |
@@ -23,12 +23,12 @@
+
= h($productCategoryVariant->id) ?> |
= h($productCategoryVariant->name) ?> |
= $productCategoryVariant->hasValue('product_category') ? $this->Html->link($productCategoryVariant->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productCategoryVariant->product_category->id]) : '' ?> |
= $productCategoryVariant->hasValue('product') ? $this->Html->link($productCategoryVariant->product->name, ['controller' => 'Products', 'action' => 'view', $productCategoryVariant->product->id]) : '' ?> |
- = $this->Number->format($productCategoryVariant->attribute_type_id) ?> |
= h($productCategoryVariant->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 @@
= __('Product') ?> |
= $productCategoryVariant->hasValue('product') ? $this->Html->link($productCategoryVariant->product->name, ['controller' => 'Products', 'action' => 'view', $productCategoryVariant->product->id]) : '' ?> |
|
-
- = __('Attribute Type Id') ?> |
- = $this->Number->format($productCategoryVariant->attribute_type_id) ?> |
-
= __('Enabled') ?> |
= $productCategoryVariant->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);
}
/**