*/ protected array $fixtures = [ 'plugin.CakeAccounting.DeJournals', 'plugin.CakeAccounting.DeJournalEntries', 'plugin.CakeAccounting.DeJournalItems', ]; /** * setUp method * * @return void */ protected function setUp(): void { parent::setUp(); // $this->enableCsrfToken(); // $this->enableSecurityToken(); $this->disableErrorHandlerMiddleware(); $config = $this->getTableLocator()->exists('DeAccounts') ? [] : ['className' => DeAccountsTable::class]; $this->DeAccounts = $this->getTableLocator()->get('DeAccounts', $config); $config = $this->getTableLocator()->exists('DeJournalItems') ? [] : ['className' => DeJournalItemsTable::class]; $this->DeJournalItems = $this->getTableLocator()->get('DeJournalItems', $config); } /** * tearDown method * * @return void */ protected function tearDown(): void { unset($this->DeJournalItems); parent::tearDown(); } /** * Test index method * * Tests the index action with a logged in user * * @return void * @throws Exception * * @uses DeJournalItemsController::index */ public function testIndexGetLoggedIn(): void { //$this->loginUserByRole('admin'); $url = [ 'plugin' => 'CakeAccounting', 'controller' => 'DeJournalItems', 'action' => 'index', ]; $this->get($url); $this->assertResponseCode(200); } /** * Test view method * * Tests the view action with a logged in user * * @return void * @throws Exception * * @uses DeJournalItemsController::view */ public function testViewGetLoggedIn(): void { $id = 1; //$this->loginUserByRole('admin'); $url = [ 'plugin' => 'CakeAccounting', 'controller' => 'DeJournalItems', 'action' => 'view', $id, ]; $this->get($url); $this->assertResponseCode(200); } }