diff --git a/composer.json b/composer.json index 0b340b8..8db7aa9 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,6 @@ "php": ">=8.2", "dereuromark/cakephp-tools": "^3.9", "muffin/trash": "^4.2", - "hi-powered-dev/cheese-cake": "dev-prod", "cakephp/cakephp": "^5.0.1", "bentools/cartesian-product": "dev-master" }, diff --git a/src/Controller/ExternalProductCatalogsController.php b/src/Controller/ExternalProductCatalogsController.php index 3e81d0a..b9446c6 100644 --- a/src/Controller/ExternalProductCatalogsController.php +++ b/src/Controller/ExternalProductCatalogsController.php @@ -7,8 +7,6 @@ use Cake\Core\Configure; use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; -use CakeProducts\Controller\AppController; -use CheeseCake\Controller\Traits\OverrideTableTrait; /** * ExternalProductCatalogs Controller @@ -17,7 +15,7 @@ use CheeseCake\Controller\Traits\OverrideTableTrait; */ class ExternalProductCatalogsController extends AppController { - use OverrideTableTrait; +// use OverrideTableTrait; /** * @return void diff --git a/src/Controller/ExternalProductCatalogsProductCatalogsController.php b/src/Controller/ExternalProductCatalogsProductCatalogsController.php index 228c47a..d63835a 100644 --- a/src/Controller/ExternalProductCatalogsProductCatalogsController.php +++ b/src/Controller/ExternalProductCatalogsProductCatalogsController.php @@ -6,7 +6,6 @@ namespace CakeProducts\Controller; use Cake\Datasource\Exception\RecordNotFoundException; use Cake\Http\Response; use Cake\Log\Log; -use CakeProducts\Controller\AppController; /** * ExternalProductCatalogsProductCatalogs Controller diff --git a/src/Controller/ProductCatalogsController.php b/src/Controller/ProductCatalogsController.php index c3af13e..ea70b4c 100644 --- a/src/Controller/ProductCatalogsController.php +++ b/src/Controller/ProductCatalogsController.php @@ -9,9 +9,6 @@ use Cake\Http\Response; use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; -use CakeProducts\Controller\AppController; -use CheeseCake\Controller\Traits\OverrideTableTrait; -; use CakeProducts\Model\Table\ProductCatalogsTable; /** @@ -21,8 +18,6 @@ use CakeProducts\Model\Table\ProductCatalogsTable; */ class ProductCatalogsController extends AppController { - use OverrideTableTrait; - /** * @return void */ @@ -40,7 +35,7 @@ class ProductCatalogsController extends AppController */ public function index() { - $query = $this->getTable()->find(); + $query = $this->ProductCatalogs->find(); $productCatalogs = $this->paginate($query); $this->set(compact('productCatalogs')); @@ -59,7 +54,7 @@ class ProductCatalogsController extends AppController if (Configure::read('CakeProducts.internal.syncExternally', false)) { $contain[] = 'ExternalProductCatalogs'; } - $productCatalog = $this->getTable()->get($id, contain: $contain); + $productCatalog = $this->ProductCatalogs->get($id, contain: $contain); $this->set(compact('productCatalog')); } @@ -70,7 +65,7 @@ class ProductCatalogsController extends AppController */ public function add() { - $productCatalogsTable = $this->getTable(); + $productCatalogsTable = $this->ProductCatalogs; $productCatalog = $productCatalogsTable->newEmptyEntity(); if ($this->request->is('post')) { $productCatalog = $productCatalogsTable->patchEntity($productCatalog, $this->request->getData()); @@ -97,7 +92,7 @@ class ProductCatalogsController extends AppController */ public function edit($id = null) { - $productCatalogsTable = $this->getTable(); + $productCatalogsTable = $this->ProductCatalogs; $productCatalog = $productCatalogsTable->get($id, contain: []); if ($this->request->is(['patch', 'post', 'put'])) { $productCatalog = $productCatalogsTable->patchEntity($productCatalog, $this->request->getData()); @@ -121,7 +116,7 @@ class ProductCatalogsController extends AppController public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); - $productCatalogsTable = $this->getTable(); + $productCatalogsTable = $this->ProductCatalogs; $productCatalog = $productCatalogsTable->get($id); if ($productCatalogsTable->delete($productCatalog)) { $this->Flash->success(__('The product catalog has been deleted.')); @@ -131,21 +126,4 @@ class ProductCatalogsController extends AppController return $this->redirect(['action' => 'index']); } - - /** - * Gets the users table instance - * - * @return Table - */ - public function getTable() - { - if ($this->_table instanceof Table) { - return $this->_table; - } - $this->_table = TableRegistry::getTableLocator()->get( - Configure::read('CakeProducts.ProductCatalogs.table', 'CakeProducts.ProductCatalogs') - ); - - return $this->_table; - } } diff --git a/src/Controller/ProductCategoriesController.php b/src/Controller/ProductCategoriesController.php index 379d896..986ee02 100644 --- a/src/Controller/ProductCategoriesController.php +++ b/src/Controller/ProductCategoriesController.php @@ -8,8 +8,6 @@ use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; use Cake\Utility\Text; -use CheeseCake\Controller\Traits\OverrideTableTrait; -; /** * ProductCategories Controller @@ -18,8 +16,6 @@ use CheeseCake\Controller\Traits\OverrideTableTrait; */ class ProductCategoriesController extends AppController { - use OverrideTableTrait; - /** * @return void */ @@ -37,7 +33,7 @@ class ProductCategoriesController extends AppController */ public function index() { - $query = $this->getTable()->find() + $query = $this->ProductCategories->find() ->contain(['ProductCatalogs', 'ParentProductCategories']); $productCategories = $this->paginate($query); @@ -53,7 +49,7 @@ class ProductCategoriesController extends AppController */ public function view($id = null) { - $productCategory = $this->getTable()->get($id, contain: [ + $productCategory = $this->ProductCategories->get($id, contain: [ 'ProductCatalogs', 'ParentProductCategories', 'ChildProductCategories', @@ -62,7 +58,7 @@ class ProductCategoriesController extends AppController 'PrimaryProductPhotos', ]); - $productCategoryAttributes = $this->getTable()->ProductCategoryAttributes->getAllCategoryAttributesForCategoryId($productCategory->internal_id); + $productCategoryAttributes = $this->ProductCategories->ProductCategoryAttributes->getAllCategoryAttributesForCategoryId($productCategory->internal_id); $this->set(compact('productCategory', 'productCategoryAttributes')); } @@ -73,7 +69,7 @@ class ProductCategoriesController extends AppController */ public function add() { - $productCategoriesTable = $this->getTable(); + $productCategoriesTable = $this->ProductCategories; $productCategory = $productCategoriesTable->newEmptyEntity(); if ($this->request->is('post')) { $postData = $this->request->getData(); @@ -112,7 +108,7 @@ class ProductCategoriesController extends AppController */ public function edit($id = null) { - $productCategoriesTable = $this->getTable(); + $productCategoriesTable = $this->ProductCategories; $productCategory = $productCategoriesTable->get($id, contain: []); if ($this->request->is(['patch', 'post', 'put'])) { $postData = $this->request->getData(); @@ -139,7 +135,7 @@ class ProductCategoriesController extends AppController public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); - $productCategoriesTable = $this->getTable(); + $productCategoriesTable = $this->ProductCategories; $productCategory = $productCategoriesTable->get($id); // $productCategoriesTable->behaviors()->get('Tree')->setConfig([ @@ -161,7 +157,7 @@ class ProductCategoriesController extends AppController */ public function select() { - $productCategoriesTable = $this->getTable(); + $productCategoriesTable = $this->ProductCategories; $productCategoriesTable->behaviors()->get('Tree')->setConfig([ 'scope' => [ 'product_catalog_id' => $this->request->getQuery('product_catalog_id', -1), diff --git a/src/Controller/ProductCategoryAttributeOptionsController.php b/src/Controller/ProductCategoryAttributeOptionsController.php index 93c9dfb..7bbed8b 100644 --- a/src/Controller/ProductCategoryAttributeOptionsController.php +++ b/src/Controller/ProductCategoryAttributeOptionsController.php @@ -7,9 +7,6 @@ use Cake\Core\Configure; use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; -use CakeProducts\Controller\AppController; -use CheeseCake\Controller\Traits\OverrideTableTrait; -; /** * ProductCategoryAttributeOptions Controller @@ -18,8 +15,6 @@ use CheeseCake\Controller\Traits\OverrideTableTrait; */ class ProductCategoryAttributeOptionsController extends AppController { - use OverrideTableTrait; - /** * @return void */ @@ -39,7 +34,7 @@ class ProductCategoryAttributeOptionsController extends AppController { Log::debug('inside product category attribute options controller add'); - $productCategoryAttributeOption = $this->getTable()->newEmptyEntity(); + $productCategoryAttributeOption = $this->ProductCategoryAttributeOptions->newEmptyEntity(); $this->set(compact('productCategoryAttributeOption')); } @@ -53,7 +48,7 @@ class ProductCategoryAttributeOptionsController extends AppController public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); - $productCategoryAttributeOptionsTable = $this->getTable(); + $productCategoryAttributeOptionsTable = $this->ProductCategoryAttributeOptions; $productCategoryAttributeOption = $productCategoryAttributeOptionsTable->get($id); if ($productCategoryAttributeOptionsTable->delete($productCategoryAttributeOption)) { diff --git a/src/Controller/ProductCategoryAttributesController.php b/src/Controller/ProductCategoryAttributesController.php index aa820aa..e4cc336 100644 --- a/src/Controller/ProductCategoryAttributesController.php +++ b/src/Controller/ProductCategoryAttributesController.php @@ -9,8 +9,6 @@ use Cake\Http\Response; use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; -use CakeProducts\Controller\AppController; -use CheeseCake\Controller\Traits\OverrideTableTrait; use CakeProducts\Model\Enum\ProductCategoryAttributeTypeId; use CakeProducts\Model\Table\ProductCategoryAttributesTable; @@ -21,8 +19,6 @@ use CakeProducts\Model\Table\ProductCategoryAttributesTable; */ class ProductCategoryAttributesController extends AppController { - use OverrideTableTrait; - /** * @return void */ @@ -40,7 +36,7 @@ class ProductCategoryAttributesController extends AppController */ public function index() { - $query = $this->getTable()->find() + $query = $this->ProductCategoryAttributes->find() ->contain(['ProductCategories']); $productCategoryAttributes = $this->paginate($query); @@ -56,7 +52,7 @@ class ProductCategoryAttributesController extends AppController */ public function view($id = null) { - $productCategoryAttribute = $this->getTable()->get($id, contain: [ + $productCategoryAttribute = $this->ProductCategoryAttributes->get($id, contain: [ 'ProductCategories', 'ProductCategoryAttributeOptions', ]); @@ -71,7 +67,7 @@ class ProductCategoryAttributesController extends AppController */ public function add() { - $productCategoryAttributesTable = $this->getTable(); + $productCategoryAttributesTable = $this->ProductCategoryAttributes; $productCategoryAttribute = $productCategoryAttributesTable->newEmptyEntity(); if ($this->request->is('post')) { $postData = $this->request->getData(); @@ -113,7 +109,7 @@ class ProductCategoryAttributesController extends AppController */ public function edit($id = null) { - $productCategoryAttributesTable = $this->getTable(); + $productCategoryAttributesTable = $this->ProductCategoryAttributes; $productCategoryAttribute = $productCategoryAttributesTable->get($id, contain: ['ProductCategoryAttributeOptions']); if ($this->request->is(['patch', 'post', 'put'])) { $postData = $this->request->getData(); @@ -155,7 +151,7 @@ class ProductCategoryAttributesController extends AppController { $this->request->allowMethod(['post', 'delete']); - $productCategoryAttributesTable = $this->getTable(); + $productCategoryAttributesTable = $this->ProductCategoryAttributes; $productCategoryAttribute = $productCategoryAttributesTable->get($id); if ($productCategoryAttributesTable->delete($productCategoryAttribute)) { $this->Flash->success(__('The product category attribute has been deleted.')); @@ -171,7 +167,7 @@ class ProductCategoryAttributesController extends AppController */ public function form() { - $productCategories = $this->getTable()->getAllCategoryAttributesForCategoryId($this->request->getQuery('product_category_id', '-1')); + $productCategories = $this->ProductCategoryAttributes->getAllCategoryAttributesForCategoryId($this->request->getQuery('product_category_id', '-1')); $this->set(compact('productCategories')); } diff --git a/src/Controller/ProductCategoryVariantsController.php b/src/Controller/ProductCategoryVariantsController.php index 7d3b6b8..aa94160 100644 --- a/src/Controller/ProductCategoryVariantsController.php +++ b/src/Controller/ProductCategoryVariantsController.php @@ -3,12 +3,10 @@ declare(strict_types=1); namespace CakeProducts\Controller; -use App\Controller\AppController; use Cake\Core\Configure; use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; -use CheeseCake\Controller\Traits\OverrideTableTrait; /** * ProductCategoryVariants Controller @@ -17,8 +15,6 @@ use CheeseCake\Controller\Traits\OverrideTableTrait; */ class ProductCategoryVariantsController extends AppController { - use OverrideTableTrait; - /** * @return void */ @@ -36,7 +32,7 @@ class ProductCategoryVariantsController extends AppController */ public function index() { - $query = $this->getTable()->find() + $query = $this->ProductCategoryVariants->find() ->contain(['ProductCategories', 'Products', 'ProductCategoryVariantOptions']); $productCategoryVariants = $this->paginate($query); @@ -52,7 +48,7 @@ class ProductCategoryVariantsController extends AppController */ public function view($id = null) { - $productCategoryVariant = $this->getTable()->get($id, contain: [ + $productCategoryVariant = $this->ProductCategoryVariants->get($id, contain: [ 'ProductCategories', 'Products', 'ProductCategoryVariantOptions', @@ -67,7 +63,7 @@ class ProductCategoryVariantsController extends AppController */ public function add() { - $productCategoryVariantsTable = $this->getTable(); + $productCategoryVariantsTable = $this->ProductCategoryVariants; $productCategoryVariant = $productCategoryVariantsTable->newEmptyEntity(); if ($this->request->is('post')) { @@ -104,7 +100,7 @@ class ProductCategoryVariantsController extends AppController */ public function edit($id = null) { - $productCategoryVariantsTable = $this->getTable(); + $productCategoryVariantsTable = $this->ProductCategoryVariants; $productCategoryVariant = $productCategoryVariantsTable->get($id, contain: []); if ($this->request->is(['patch', 'post', 'put'])) { $postData = $this->request->getData(); @@ -150,7 +146,7 @@ class ProductCategoryVariantsController extends AppController public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); - $productCategoryVariantsTable = $this->getTable(); + $productCategoryVariantsTable = $this->ProductCategoryVariants; $productCategoryVariant = $productCategoryVariantsTable->get($id); if ($productCategoryVariantsTable->delete($productCategoryVariant)) { diff --git a/src/Controller/ProductPhotosController.php b/src/Controller/ProductPhotosController.php index 7668f47..b07cd3d 100644 --- a/src/Controller/ProductPhotosController.php +++ b/src/Controller/ProductPhotosController.php @@ -8,9 +8,7 @@ use Cake\Datasource\Exception\RecordNotFoundException; use Cake\Http\Exception\ForbiddenException; use Cake\Http\Response; use Cake\Utility\Text; -use CakeProducts\Controller\AppController; use CakeProducts\Model\Table\ProductPhotosTable; -use CheeseCake\Controller\Traits\OverrideTableTrait; use Psr\Http\Message\UploadedFileInterface; /** @@ -20,8 +18,6 @@ use Psr\Http\Message\UploadedFileInterface; */ class ProductPhotosController extends AppController { - use OverrideTableTrait; - /** * Index method * @@ -29,7 +25,7 @@ class ProductPhotosController extends AppController */ public function index() { - $query = $this->getTable()->find() + $query = $this->ProductPhotos->find() ->contain(['Products', 'ProductSkus', 'ProductCategories']); $productPhotos = $this->paginate($query); @@ -45,7 +41,7 @@ class ProductPhotosController extends AppController */ public function view($id = null) { - $productPhoto = $this->getTable()->get($id, contain: ['Products', 'ProductSkus', 'ProductCategories']); + $productPhoto = $this->ProductPhotos->get($id, contain: ['Products', 'ProductSkus', 'ProductCategories']); $this->set(compact('productPhoto')); } @@ -56,7 +52,7 @@ class ProductPhotosController extends AppController */ public function add() { - $productPhotosTable = $this->getTable(); + $productPhotosTable = $this->ProductPhotos; $productPhoto = $productPhotosTable->newEmptyEntity(); if ($this->request->is('post')) { if (!$this->request->getData('photo')) { @@ -161,7 +157,7 @@ class ProductPhotosController extends AppController */ public function edit($id = null) { - $productPhotosTable = $this->getTable(); + $productPhotosTable = $this->ProductPhotos; $productPhoto = $productPhotosTable->get($id, contain: []); if ($this->request->is(['patch', 'post', 'put'])) { $postData = $this->request->getData(); @@ -189,7 +185,7 @@ class ProductPhotosController extends AppController public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); - $productPhotosTable = $this->getTable(); + $productPhotosTable = $this->ProductPhotos; $productPhoto = $productPhotosTable->get($id); if ($productPhotosTable->delete($productPhoto)) { @@ -207,7 +203,7 @@ class ProductPhotosController extends AppController */ public function image($id = null) { - $productPhoto = $this->getTable()->get($id); + $productPhoto = $this->ProductPhotos->get($id); $fullPath = Configure::readOrFail('CakeProducts.photos.directory') . $productPhoto->photo_dir . DS . $productPhoto->photo_filename; diff --git a/src/Controller/ProductSkusController.php b/src/Controller/ProductSkusController.php index 891ab4b..f8991e4 100644 --- a/src/Controller/ProductSkusController.php +++ b/src/Controller/ProductSkusController.php @@ -5,7 +5,6 @@ namespace CakeProducts\Controller; use Cake\Log\Log; use Cake\Utility\Hash; -use CheeseCake\Controller\Traits\OverrideTableTrait; use function BenTools\CartesianProduct\combinations; /** @@ -15,8 +14,6 @@ use function BenTools\CartesianProduct\combinations; */ class ProductSkusController extends AppController { - use OverrideTableTrait; - /** * @return void */ @@ -69,9 +66,7 @@ class ProductSkusController extends AppController { $toGetCartesianProductsFrom = []; $productSkus = []; - $table = $this->getTable(); - - $product = $table->Products->get($productId, contain: [ + $product = $this->ProductSkus->Products->get($productId, contain: [ 'ProductSkus', 'ProductSkus.ProductSkuVariantValues', 'ProductVariants', @@ -103,7 +98,7 @@ class ProductSkusController extends AppController $numSkusToAdd = count(combinations($toGetCartesianProductsFrom)); for ($i = 0; $i < $numSkusToAdd; $i++) { - $productSkus[$i] = $this->getTable()->newEmptyEntity(); + $productSkus[$i] = $this->ProductSkus->newEmptyEntity(); } $this->set(compact( 'product', @@ -159,13 +154,13 @@ class ProductSkusController extends AppController return; } // dd($finalPostData); - $productSkus = $table->patchEntities($productSkus, $finalPostData, $saveOptions); + $productSkus = $this->ProductSkus->patchEntities($productSkus, $finalPostData, $saveOptions); $errors = []; $successes = []; foreach ($productSkus as $productSkuToSave) { // dd($productSkuToSave); - if (!$table->save($productSkuToSave, $saveOptions)) { + if (!$this->ProductSkus->save($productSkuToSave, $saveOptions)) { Log::debug(print_r('$productSkuToSave->getErrors()', true)); Log::debug(print_r($productSkuToSave->getErrors(), true)); dd($productSkuToSave->getErrors()); @@ -245,7 +240,7 @@ class ProductSkusController extends AppController */ public function select() { - $productSkus = $this->getTable() + $productSkus = $this->ProductSkus ->find('list') ->where(['product_id' => $this->request->getQuery('product_id', '-1')]) ->orderBy(['sku']) diff --git a/src/Controller/ProductVariantsController.php b/src/Controller/ProductVariantsController.php index 233864b..d74ab84 100644 --- a/src/Controller/ProductVariantsController.php +++ b/src/Controller/ProductVariantsController.php @@ -3,7 +3,6 @@ declare(strict_types=1); namespace CakeProducts\Controller; -use App\Controller\AppController; use Cake\Log\Log; /** diff --git a/src/Controller/ProductsController.php b/src/Controller/ProductsController.php index e1c0368..4046a6f 100644 --- a/src/Controller/ProductsController.php +++ b/src/Controller/ProductsController.php @@ -7,9 +7,6 @@ use Cake\Core\Configure; use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; -use CakeProducts\Controller\AppController; -use CheeseCake\Controller\Traits\OverrideTableTrait; -; /** * Products Controller @@ -18,8 +15,6 @@ use CheeseCake\Controller\Traits\OverrideTableTrait; */ class ProductsController extends AppController { - use OverrideTableTrait; - /** * @return void */ @@ -37,7 +32,7 @@ class ProductsController extends AppController */ public function index() { - $query = $this->getTable()->find() + $query = $this->Products->find() ->contain(['ProductCategories']); $products = $this->paginate($query); @@ -53,7 +48,7 @@ class ProductsController extends AppController */ public function view($id = null) { - $product = $this->getTable()->get($id, contain: [ + $product = $this->Products->get($id, contain: [ 'ProductCategories', 'ProductAttributes', 'ProductAttributes.ProductCategoryAttributes', @@ -74,7 +69,7 @@ class ProductsController extends AppController */ public function add() { - $productsTable = $this->getTable(); + $productsTable = $this->Products; $product = $productsTable->newEmptyEntity(); if ($this->request->is('post')) { $postData = $this->request->getData(); @@ -151,7 +146,7 @@ class ProductsController extends AppController */ public function edit($id = null) { - $productsTable = $this->getTable(); + $productsTable = $this->Products; $product = $productsTable->get($id, contain: [ 'ProductAttributes', 'ProductAttributes.ProductCategoryAttributes', @@ -187,7 +182,7 @@ class ProductsController extends AppController { $this->request->allowMethod(['post', 'delete']); - $productsTable = $this->getTable(); + $productsTable = $this->Products; $product = $productsTable->get($id); if ($productsTable->delete($product)) { $this->Flash->success(__('The product has been deleted.')); @@ -203,7 +198,7 @@ class ProductsController extends AppController */ public function select() { - $productsTable = $this->getTable(); + $productsTable = $this->Products; $productCategory = $productsTable->ProductCategories->find() ->where(['id' => $this->request->getQuery('product_category_id', '-1')]) ->first(); diff --git a/tests/TestCase/Controller/BaseControllerTest.php b/tests/TestCase/Controller/BaseControllerTest.php index d58415c..5bc56d4 100644 --- a/tests/TestCase/Controller/BaseControllerTest.php +++ b/tests/TestCase/Controller/BaseControllerTest.php @@ -9,6 +9,11 @@ use FilesystemIterator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; +/** + * BaseControllerTest + * + * Used to make logging in easier and to handle folder structure for product images + */ class BaseControllerTest extends TestCase { use IntegrationTestTrait; diff --git a/tests/TestCase/Controller/ExternalProductCatalogsControllerTest.php b/tests/TestCase/Controller/ExternalProductCatalogsControllerTest.php index 204a6b7..50a151f 100644 --- a/tests/TestCase/Controller/ExternalProductCatalogsControllerTest.php +++ b/tests/TestCase/Controller/ExternalProductCatalogsControllerTest.php @@ -11,12 +11,12 @@ use Cake\TestSuite\TestCase; use CakeProducts\Controller\ExternalProductCatalogsController; use CakeProducts\Model\Table\ExternalProductCatalogsTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ExternalProductCatalogsController Test Case - * - * @uses \CakeProducts\Controller\ExternalProductCatalogsController */ +#[CoversClass(ExternalProductCatalogsController::class)] class ExternalProductCatalogsControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ExternalProductCatalogsProductCatalogsControllerTest.php b/tests/TestCase/Controller/ExternalProductCatalogsProductCatalogsControllerTest.php index d22ee89..b5b1160 100644 --- a/tests/TestCase/Controller/ExternalProductCatalogsProductCatalogsControllerTest.php +++ b/tests/TestCase/Controller/ExternalProductCatalogsProductCatalogsControllerTest.php @@ -9,12 +9,12 @@ use Cake\TestSuite\IntegrationTestTrait; use Cake\TestSuite\TestCase; use CakeProducts\Model\Table\ExternalProductCatalogsProductCatalogsTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ExternalProductCatalogsProductCatalogsController Test Case - * - * @uses \CakeProducts\Controller\ExternalProductCatalogsProductCatalogsController */ +#[CoversClass(ExternalProductCatalogsProductCatalogsController::class)] class ExternalProductCatalogsProductCatalogsControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ProductCatalogsControllerTest.php b/tests/TestCase/Controller/ProductCatalogsControllerTest.php index 8b39964..5601bc8 100644 --- a/tests/TestCase/Controller/ProductCatalogsControllerTest.php +++ b/tests/TestCase/Controller/ProductCatalogsControllerTest.php @@ -9,12 +9,12 @@ use Cake\TestSuite\TestCase; use CakeProducts\Controller\ProductCatalogsController; use CakeProducts\Model\Table\ProductCatalogsTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ProductCatalogsController Test Case - * - * @uses \CakeProducts\Controller\ProductCatalogsController */ +#[CoversClass(ProductCatalogsController::class)] class ProductCatalogsControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ProductCategoriesControllerTest.php b/tests/TestCase/Controller/ProductCategoriesControllerTest.php index 022b9f5..9ddf42b 100644 --- a/tests/TestCase/Controller/ProductCategoriesControllerTest.php +++ b/tests/TestCase/Controller/ProductCategoriesControllerTest.php @@ -9,12 +9,12 @@ use Cake\TestSuite\TestCase; use CakeProducts\Controller\ProductCategoriesController; use CakeProducts\Model\Table\ProductCategoriesTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ProductCategoriesController Test Case - * - * @uses \CakeProducts\Controller\ProductCategoriesController */ +#[CoversClass(ProductCategoriesController::class)] class ProductCategoriesControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ProductCategoryAttributeOptionsControllerTest.php b/tests/TestCase/Controller/ProductCategoryAttributeOptionsControllerTest.php index 745fd81..1f3c35b 100644 --- a/tests/TestCase/Controller/ProductCategoryAttributeOptionsControllerTest.php +++ b/tests/TestCase/Controller/ProductCategoryAttributeOptionsControllerTest.php @@ -7,12 +7,12 @@ use Cake\ORM\Table; use CakeProducts\Controller\ProductCategoryAttributeOptionsController; use CakeProducts\Model\Table\ProductCategoryAttributeOptionsTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ProductCategoryAttributeOptionsController Test Case - * - * @uses \CakeProducts\Controller\ProductCategoryAttributeOptionsController */ +#[CoversClass(ProductCategoryAttributeOptionsController::class)] class ProductCategoryAttributeOptionsControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ProductCategoryAttributesControllerTest.php b/tests/TestCase/Controller/ProductCategoryAttributesControllerTest.php index 831634e..a3084e1 100644 --- a/tests/TestCase/Controller/ProductCategoryAttributesControllerTest.php +++ b/tests/TestCase/Controller/ProductCategoryAttributesControllerTest.php @@ -9,12 +9,12 @@ use Cake\TestSuite\TestCase; use CakeProducts\Controller\ProductCategoryAttributesController; use CakeProducts\Model\Table\ProductCategoryAttributesTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ProductCategoryAttributesController Test Case - * - * @uses \CakeProducts\Controller\ProductCategoryAttributesController */ +#[CoversClass(ProductCategoryAttributesController::class)] class ProductCategoryAttributesControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ProductCategoryVariantsControllerTest.php b/tests/TestCase/Controller/ProductCategoryVariantsControllerTest.php index c9006ed..cafd242 100644 --- a/tests/TestCase/Controller/ProductCategoryVariantsControllerTest.php +++ b/tests/TestCase/Controller/ProductCategoryVariantsControllerTest.php @@ -9,12 +9,12 @@ use CakeProducts\Model\Table\ProductCategoryAttributesTable; use CakeProducts\Model\Table\ProductCategoryVariantOptionsTable; use CakeProducts\Model\Table\ProductCategoryVariantsTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ProductCategoryVariantsController Test Case - * - * @uses \CakeProducts\Controller\ProductCategoryVariantsController */ +#[CoversClass(ProductCategoryVariantsController::class)] class ProductCategoryVariantsControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ProductPhotosControllerTest.php b/tests/TestCase/Controller/ProductPhotosControllerTest.php index c0aae77..246b3ea 100644 --- a/tests/TestCase/Controller/ProductPhotosControllerTest.php +++ b/tests/TestCase/Controller/ProductPhotosControllerTest.php @@ -11,15 +11,15 @@ use CakeProducts\Model\Table\ProductsTable; use FilesystemIterator; use Laminas\Diactoros\UploadedFile; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use const UPLOAD_ERR_OK; /** * CakeProducts\Controller\ProductPhotosController Test Case - * - * @uses \CakeProducts\Controller\ProductPhotosController */ +#[CoversClass(ProductPhotosController::class)] class ProductPhotosControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ProductSkusControllerTest.php b/tests/TestCase/Controller/ProductSkusControllerTest.php index 33c3a36..9920990 100644 --- a/tests/TestCase/Controller/ProductSkusControllerTest.php +++ b/tests/TestCase/Controller/ProductSkusControllerTest.php @@ -11,12 +11,12 @@ use CakeProducts\Model\Table\ProductSkusTable; use CakeProducts\Model\Table\ProductSkuVariantValuesTable; use CakeProducts\Model\Table\ProductsTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ProductSkusController Test Case - * - * @uses \CakeProducts\Controller\ProductSkusController */ +#[CoversClass(ProductSkusController::class)] class ProductSkusControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Controller/ProductsControllerTest.php b/tests/TestCase/Controller/ProductsControllerTest.php index 4448e90..38481d0 100644 --- a/tests/TestCase/Controller/ProductsControllerTest.php +++ b/tests/TestCase/Controller/ProductsControllerTest.php @@ -10,12 +10,12 @@ use CakeProducts\Controller\ProductsController; use CakeProducts\Model\Table\ProductCatalogsTable; use CakeProducts\Model\Table\ProductsTable; use PHPUnit\Exception; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Controller\ProductsController Test Case - * - * @uses \CakeProducts\Controller\ProductsController */ +#[CoversClass(ProductsController::class)] class ProductsControllerTest extends BaseControllerTest { /** diff --git a/tests/TestCase/Model/Table/ExternalProductCatalogsTableTest.php b/tests/TestCase/Model/Table/ExternalProductCatalogsTableTest.php index 117d18d..a0c271f 100644 --- a/tests/TestCase/Model/Table/ExternalProductCatalogsTableTest.php +++ b/tests/TestCase/Model/Table/ExternalProductCatalogsTableTest.php @@ -6,10 +6,12 @@ namespace CakeProducts\Test\TestCase\Model\Table; use Cake\ORM\Table; use Cake\TestSuite\TestCase; use CakeProducts\Model\Table\ExternalProductCatalogsTable; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Model\Table\ExternalProductCatalogsTable Test Case */ +#[CoversClass(ExternalProductCatalogsTable::class)] class ExternalProductCatalogsTableTest extends TestCase { /** diff --git a/tests/TestCase/Model/Table/ProductCatalogsTableTest.php b/tests/TestCase/Model/Table/ProductCatalogsTableTest.php index 115ef6c..f680cbc 100644 --- a/tests/TestCase/Model/Table/ProductCatalogsTableTest.php +++ b/tests/TestCase/Model/Table/ProductCatalogsTableTest.php @@ -6,10 +6,12 @@ namespace CakeProducts\Test\TestCase\Model\Table; use Cake\ORM\Table; use Cake\TestSuite\TestCase; use CakeProducts\Model\Table\ProductCatalogsTable; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Model\Table\ProductCatalogsTable Test Case */ +#[CoversClass(ProductCatalogsTable::class)] class ProductCatalogsTableTest extends TestCase { /** diff --git a/tests/TestCase/Model/Table/ProductCategoriesTableTest.php b/tests/TestCase/Model/Table/ProductCategoriesTableTest.php index aa4f96d..bff1d5b 100644 --- a/tests/TestCase/Model/Table/ProductCategoriesTableTest.php +++ b/tests/TestCase/Model/Table/ProductCategoriesTableTest.php @@ -5,10 +5,12 @@ namespace CakeProducts\Test\TestCase\Model\Table; use Cake\TestSuite\TestCase; use CakeProducts\Model\Table\ProductCategoriesTable; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Model\Table\ProductCategoriesTable Test Case */ +#[CoversClass(ProductCategoriesTable::class)] class ProductCategoriesTableTest extends TestCase { /** diff --git a/tests/TestCase/Model/Table/ProductCategoryAttributeOptionsTableTest.php b/tests/TestCase/Model/Table/ProductCategoryAttributeOptionsTableTest.php index 6657791..9f70430 100644 --- a/tests/TestCase/Model/Table/ProductCategoryAttributeOptionsTableTest.php +++ b/tests/TestCase/Model/Table/ProductCategoryAttributeOptionsTableTest.php @@ -5,10 +5,12 @@ namespace CakeProducts\Test\TestCase\Model\Table; use Cake\TestSuite\TestCase; use CakeProducts\Model\Table\ProductCategoryAttributeOptionsTable; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Model\Table\ProductCategoryAttributeOptionsTable Test Case */ +#[CoversClass(ProductCategoryAttributeOptionsTable::class)] class ProductCategoryAttributeOptionsTableTest extends TestCase { /** diff --git a/tests/TestCase/Model/Table/ProductCategoryAttributesTableTest.php b/tests/TestCase/Model/Table/ProductCategoryAttributesTableTest.php index 3a09b75..4cc4d09 100644 --- a/tests/TestCase/Model/Table/ProductCategoryAttributesTableTest.php +++ b/tests/TestCase/Model/Table/ProductCategoryAttributesTableTest.php @@ -5,10 +5,12 @@ namespace CakeProducts\Test\TestCase\Model\Table; use Cake\TestSuite\TestCase; use CakeProducts\Model\Table\ProductCategoryAttributesTable; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Model\Table\ProductCategoryAttributesTable Test Case */ +#[CoversClass(ProductCategoryAttributesTable::class)] class ProductCategoryAttributesTableTest extends TestCase { /** diff --git a/tests/TestCase/Model/Table/ProductCategoryVariantOptionsTableTest.php b/tests/TestCase/Model/Table/ProductCategoryVariantOptionsTableTest.php index 6c7ae54..dcb7be6 100644 --- a/tests/TestCase/Model/Table/ProductCategoryVariantOptionsTableTest.php +++ b/tests/TestCase/Model/Table/ProductCategoryVariantOptionsTableTest.php @@ -5,10 +5,12 @@ namespace CakeProducts\Test\TestCase\Model\Table; use CakeProducts\Model\Table\ProductCategoryVariantOptionsTable; use Cake\TestSuite\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * App\Model\Table\ProductCategoryVariantOptionsTable Test Case */ +#[CoversClass(ProductCategoryVariantOptionsTable::class)] class ProductCategoryVariantOptionsTableTest extends TestCase { /** diff --git a/tests/TestCase/Model/Table/ProductVariantsTableTest.php b/tests/TestCase/Model/Table/ProductVariantsTableTest.php index 50c7682..0829c6e 100644 --- a/tests/TestCase/Model/Table/ProductVariantsTableTest.php +++ b/tests/TestCase/Model/Table/ProductVariantsTableTest.php @@ -57,7 +57,6 @@ class ProductVariantsTableTest extends TestCase * TestInitialize method * * @return void - * @uses \App\Model\Table\ProductVariantsTable::initialize() */ public function testInitialize(): void { diff --git a/tests/TestCase/Model/Table/ProductsTableTest.php b/tests/TestCase/Model/Table/ProductsTableTest.php index 54d3ea3..292ff92 100644 --- a/tests/TestCase/Model/Table/ProductsTableTest.php +++ b/tests/TestCase/Model/Table/ProductsTableTest.php @@ -5,10 +5,12 @@ namespace CakeProducts\Test\TestCase\Model\Table; use Cake\TestSuite\TestCase; use CakeProducts\Model\Table\ProductsTable; +use PHPUnit\Framework\Attributes\CoversClass; /** * CakeProducts\Model\Table\ProductsTable Test Case */ +#[CoversClass(ProductsTable::class)] class ProductsTableTest extends TestCase { /**