AdminAccessTest.php 852 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Tests\Application\Access;
  3. use App\Tests\Application\OtWebTestCase;
  4. class AdminAccessTest extends OtWebTestCase
  5. {
  6. public function testAdminAccessMethod(): void
  7. {
  8. $this->logger->info("\033[1;34mStarting test... get admin access ID\033[0m");
  9. $this->loginAs($this->user);
  10. $this->get('/api/admin-access/1');
  11. $this->assertResponseStatusCodeSame(200);
  12. $this->logger->info("\033[1;32mTest 'get admin access ID' succeeded\033[0m");
  13. $this->logger->info("\033[1;34mStarting test... put admin access ID\033[0m");
  14. $this->loginAs($this->user);
  15. $this->put('/api/admin-access/1', [
  16. 'username' => 'tata',
  17. ]);
  18. $this->assertResponseStatusCodeSame(200);
  19. $this->logger->info("\033[1;32mTest 'put admin access ID' succeeded\033[0m");
  20. }
  21. }