get product skus table via product photos in product photos controller

This commit is contained in:
2025-08-21 23:40:00 -07:00
parent b9bf47f385
commit 803e161a9a
4 changed files with 13 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ use Cake\Core\Configure;
use Cake\ORM\Table;
use CakeProducts\Controller\ProductPhotosController;
use CakeProducts\Model\Table\ProductPhotosTable;
use CakeProducts\Model\Table\ProductsTable;
use FilesystemIterator;
use Laminas\Diactoros\UploadedFile;
use PHPUnit\Exception;
@@ -47,7 +48,8 @@ class ProductPhotosControllerTest extends BaseControllerTest
protected function setUp(): void
{
parent::setUp();
$this->ProductPhotos = $this->getTableLocator()->get('ProductPhotos');
$config = $this->getTableLocator()->exists('ProductPhotos') ? [] : ['className' => ProductPhotosTable::class];
$this->ProductPhotos = $this->getTableLocator()->get('ProductPhotos', $config);
}
/**