composer update + load more dev dependencies for code quality, checkstyle fix
This commit is contained in:
@@ -11,107 +11,103 @@ use PHPUnit\Framework\Attributes\CoversClass;
|
||||
* CakeProducts\Model\Table\ProductsTable Test Case
|
||||
*/
|
||||
#[CoversClass(ProductsTable::class)]
|
||||
class ProductsTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
class ProductsTableTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var ProductsTable
|
||||
* @var \CakeProducts\Model\Table\ProductsTable
|
||||
*/
|
||||
protected $Products;
|
||||
protected $Products;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeProducts.Products',
|
||||
'plugin.CakeProducts.ProductCategories',
|
||||
'plugin.CakeProducts.ProductSkus',
|
||||
'plugin.CakeProducts.ProductSkuVariantValues',
|
||||
];
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeProducts.Products',
|
||||
'plugin.CakeProducts.ProductCategories',
|
||||
'plugin.CakeProducts.ProductSkus',
|
||||
'plugin.CakeProducts.ProductSkuVariantValues',
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Products') ? [] : ['className' => ProductsTable::class];
|
||||
$this->Products = $this->getTableLocator()->get('Products', $config);
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Products') ? [] : ['className' => ProductsTable::class];
|
||||
$this->Products = $this->getTableLocator()->get('Products', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Products);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Products);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* TestInitialize method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeProducts\Model\Table\ProductsTable::initialize
|
||||
* @return void
|
||||
*/
|
||||
public function testInitialize(): void
|
||||
{
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'ProductCategories',
|
||||
'ProductAttributes',
|
||||
'ProductVariants',
|
||||
'ProductSkus',
|
||||
'ProductPhotos',
|
||||
'PrimaryProductPhotos',
|
||||
'DefaultProductSkus',
|
||||
];
|
||||
$associations = $this->Products->associations();
|
||||
public function testInitialize(): void {
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'ProductCategories',
|
||||
'ProductAttributes',
|
||||
'ProductVariants',
|
||||
'ProductSkus',
|
||||
'ProductPhotos',
|
||||
'PrimaryProductPhotos',
|
||||
'DefaultProductSkus',
|
||||
];
|
||||
$associations = $this->Products->associations();
|
||||
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->Products->hasAssociation($expectedAssociation));
|
||||
}
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->Products->hasAssociation($expectedAssociation));
|
||||
}
|
||||
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [
|
||||
'Trash',
|
||||
];
|
||||
$behaviors = $this->Products->behaviors();
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [
|
||||
'Trash',
|
||||
];
|
||||
$behaviors = $this->Products->behaviors();
|
||||
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->Products->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->Products->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeProducts\Model\Table\ProductsTable::validationDefault
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testValidationDefault(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test buildRules method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeProducts\Model\Table\ProductsTable::buildRules
|
||||
* @return void
|
||||
*/
|
||||
public function testBuildRules(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testBuildRules(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user