tests fixed
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user