diff --git a/framework/core/tests/integration/api/notifications/ListTest.php b/framework/core/tests/integration/api/notifications/ListTest.php index 1e0b3d2c6..946885483 100644 --- a/framework/core/tests/integration/api/notifications/ListTest.php +++ b/framework/core/tests/integration/api/notifications/ListTest.php @@ -24,9 +24,6 @@ class ListTest extends TestCase 'users' => [ $this->normalUser(), ], - 'access_tokens' => [ - ['token' => 'normaltoken', 'user_id' => 2], - ], ]); } @@ -48,8 +45,9 @@ class ListTest extends TestCase public function shows_index_for_user() { $response = $this->send( - $this->request('GET', '/api/notifications') - ->withHeader('Authorization', 'Token normaltoken') + $this->request('GET', '/api/notifications', [ + 'authenticatedAs' => 2, + ]) ); $this->assertEquals(200, $response->getStatusCode()); diff --git a/framework/core/tests/integration/api/users/CreationTest.php b/framework/core/tests/integration/api/users/CreationTest.php index 25c763577..65351c0e6 100644 --- a/framework/core/tests/integration/api/users/CreationTest.php +++ b/framework/core/tests/integration/api/users/CreationTest.php @@ -35,9 +35,6 @@ class CreationTest extends TestCase 'settings' => [ ['key' => 'mail_driver', 'value' => 'log'], ], - 'access_tokens' => [ - ['token' => 'admintoken', 'user_id' => 1], - ], ]); } @@ -128,6 +125,7 @@ class CreationTest extends TestCase 'POST', '/api/users', [ + 'authenticatedAs' => 1, 'json' => [ 'data' => [ 'attributes' => [ @@ -139,7 +137,7 @@ class CreationTest extends TestCase ] ], ] - )->withHeader('Authorization', 'Token admintoken') + ) ); $this->assertEquals(201, $response->getStatusCode()); diff --git a/framework/core/tests/integration/api/users/ListTest.php b/framework/core/tests/integration/api/users/ListTest.php index 4aff4e5da..627998f12 100644 --- a/framework/core/tests/integration/api/users/ListTest.php +++ b/framework/core/tests/integration/api/users/ListTest.php @@ -33,9 +33,6 @@ class ListTest extends TestCase 'group_user' => [ ['user_id' => 1, 'group_id' => 1], ], - 'access_tokens' => [ - ['token' => 'admintoken', 'user_id' => 1], - ], ]); } @@ -76,8 +73,9 @@ class ListTest extends TestCase public function shows_index_for_admin() { $response = $this->send( - $this->request('GET', '/api/users') - ->withHeader('Authorization', 'Token admintoken') + $this->request('GET', '/api/users', [ + 'authenticatedAs' => 1, + ]) ); $this->assertEquals(200, $response->getStatusCode());