tests fixed

This commit is contained in:
2025-03-27 01:44:16 -07:00
parent 2138762fb2
commit 3719bbef53
13 changed files with 26 additions and 369 deletions

View File

@@ -43,8 +43,9 @@ class ExternalProductCatalogsControllerTest extends BaseControllerTest
protected function setUp(): void
{
parent::setUp();
$this->enableCsrfToken();
$this->enableSecurityToken();
// $this->enableCsrfToken();
// $this->enableSecurityToken();
$this->disableErrorHandlerMiddleware();
$this->ExternalProductCatalogs = $this->getTableLocator()->get('ExternalProductCatalogs');
}

View File

@@ -42,8 +42,9 @@ class ProductCatalogsControllerTest extends BaseControllerTest
protected function setUp(): void
{
parent::setUp();
$this->enableCsrfToken();
$this->enableSecurityToken();
// $this->enableCsrfToken();
// $this->enableSecurityToken();
$this->disableErrorHandlerMiddleware();
$config = $this->getTableLocator()->exists('ProductCatalogs') ? [] : ['className' => ProductCatalogsTable::class];
$this->ProductCatalogs = $this->getTableLocator()->get('ProductCatalogs', $config);
}

View File

@@ -42,8 +42,9 @@ class ProductCategoriesControllerTest extends BaseControllerTest
protected function setUp(): void
{
parent::setUp();
$this->enableCsrfToken();
$this->enableSecurityToken();
// $this->enableCsrfToken();
// $this->enableSecurityToken();
$this->disableErrorHandlerMiddleware();
$this->ProductCategories = $this->getTableLocator()->get('ProductCategories');
}

View File

@@ -40,8 +40,8 @@ class ProductCategoryAttributeOptionsControllerTest extends BaseControllerTest
protected function setUp(): void
{
parent::setUp();
$this->enableCsrfToken();
$this->enableSecurityToken();
// $this->enableCsrfToken();
// $this->enableSecurityToken();
$config = $this->getTableLocator()->exists('ProductCategoryAttributeOptions') ? [] : ['className' => ProductCategoryAttributeOptionsTable::class];
$this->ProductCategoryAttributeOptions = $this->getTableLocator()->get('ProductCategoryAttributeOptions', $config);
}

View File

@@ -42,8 +42,8 @@ class ProductCategoryAttributesControllerTest extends BaseControllerTest
protected function setUp(): void
{
parent::setUp();
$this->enableCsrfToken();
$this->enableSecurityToken();
// $this->enableCsrfToken();
// $this->enableSecurityToken();
$config = $this->getTableLocator()->exists('ProductCategoryAttributes') ? [] : ['className' => ProductCategoryAttributesTable::class];
$this->ProductCategoryAttributes = $this->getTableLocator()->get('ProductCategoryAttributes', $config);
}

View File

@@ -44,8 +44,8 @@ class ProductsControllerTest extends BaseControllerTest
protected function setUp(): void
{
parent::setUp();
$this->enableCsrfToken();
$this->enableSecurityToken();
// $this->enableCsrfToken();
// $this->enableSecurityToken();
$config = $this->getTableLocator()->exists('Products') ? [] : ['className' => ProductsTable::class];
$this->Products = $this->getTableLocator()->get('Products', $config);
}

View File

@@ -5,6 +5,7 @@ namespace TestApp;
use Cake\Http\BaseApplication;
use Cake\Http\MiddlewareQueue;
use Cake\Routing\Middleware\RoutingMiddleware;
use Cake\Routing\Route\DashedRoute;
use Cake\Routing\RouteBuilder;
class Application extends BaseApplication {
@@ -28,6 +29,7 @@ class Application extends BaseApplication {
public function routes(RouteBuilder $routes): void
{
parent::routes($routes); // TODO: Change the autogenerated stub
$routes->setRouteClass(DashedRoute::class);
$routes->plugin('CakeProducts', ['path' => '/cake-products'], function (RouteBuilder $pluginRoutes):void {
$pluginRoutes->fallbacks();

View File

@@ -5,4 +5,12 @@ namespace TestApp\Controller;
use Cake\Controller\Controller;
class AppController extends Controller {
/**
* @return void
*/
public function initialize(): void {
parent::initialize();
$this->loadComponent('Flash');
}
}