variant options wip
This commit is contained in:
@@ -67,6 +67,7 @@ class ProductCategoriesTableTest extends TestCase
|
||||
'ChildProductCategories',
|
||||
// 'Products',
|
||||
'ProductCategoryAttributes',
|
||||
'ProductCategoryVariants',
|
||||
];
|
||||
$associations = $this->ProductCategories->associations();
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace CakeProducts\Test\TestCase\Model\Table;
|
||||
|
||||
use CakeProducts\Model\Table\ProductCategoryVariantOptionsTable;
|
||||
use Cake\TestSuite\TestCase;
|
||||
|
||||
/**
|
||||
* App\Model\Table\ProductCategoryVariantOptionsTable Test Case
|
||||
*/
|
||||
class ProductCategoryVariantOptionsTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \App\Model\Table\ProductCategoryVariantOptionsTable
|
||||
*/
|
||||
protected $ProductCategoryVariantOptions;
|
||||
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
// 'ProductCategoryVariantOptions',
|
||||
// 'ProductCategoryVariants',
|
||||
];
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('ProductCategoryVariantOptions') ? [] : ['className' => ProductCategoryVariantOptionsTable::class];
|
||||
$this->ProductCategoryVariantOptions = $this->getTableLocator()->get('ProductCategoryVariantOptions', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->ProductCategoryVariantOptions);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* TestInitialize method
|
||||
*
|
||||
* @return void
|
||||
* @uses \App\Model\Table\ProductCategoryVariantOptionsTable::initialize()
|
||||
*/
|
||||
public function testInitialize(): void
|
||||
{
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'ProductCategoryVariants',
|
||||
];
|
||||
$associations = $this->ProductCategoryVariantOptions->associations();
|
||||
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->ProductCategoryVariantOptions->hasAssociation($expectedAssociation));
|
||||
}
|
||||
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [
|
||||
'Timestamp',
|
||||
];
|
||||
$behaviors = $this->ProductCategoryVariantOptions->behaviors();
|
||||
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->ProductCategoryVariantOptions->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
* @uses \App\Model\Table\ProductCategoryVariantOptionsTable::validationDefault()
|
||||
*/
|
||||
public function testValidationDefault(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test buildRules method
|
||||
*
|
||||
* @return void
|
||||
* @uses \App\Model\Table\ProductCategoryVariantOptionsTable::buildRules()
|
||||
*/
|
||||
public function testBuildRules(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,7 @@ class ProductsTableTest extends TestCase
|
||||
$expectedAssociations = [
|
||||
'ProductCategories',
|
||||
'ProductAttributes',
|
||||
'ProductCategoryVariants',
|
||||
];
|
||||
$associations = $this->Products->associations();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user