getTableLocator()->exists('Carts') ? [] : ['className' => CartsTable::class]; $this->Carts = $this->getTableLocator()->get('Carts', $config); } public function testIndex(): void { $url = [ 'plugin' => 'CakeCarts', 'controller' => 'Carts', 'action' => 'index', ]; $this->get($url); $this->assertResponseCode(200); } }