. */ declare(strict_types=1); namespace Tests\Api\V1\Controllers; use Laravel\Passport\Passport; use Tests\TestCase; /** * Class AboutControllerTest */ class AboutControllerTest extends TestCase { /** * Set up test */ public function setUp() { parent::setUp(); Passport::actingAs($this->user()); } /** * Test the about endpoint * * @covers \FireflyIII\Api\V1\Controllers\AboutController::__construct * @covers \FireflyIII\Api\V1\Controllers\AboutController::about */ public function testAbout() { // test API $response = $this->get('/api/v1/about'); $response->assertStatus(200); $response->assertJson( ['data' => [ 'version' => true, 'api_version' => true, 'php_version' => true, ]] ); } /** * Test user end point * * @covers \FireflyIII\Api\V1\Controllers\AboutController::user */ public function testUser() { // test API $response = $this->get('/api/v1/about/user'); $response->assertStatus(200); $response->assertJson(['data' => ['attributes' => true, 'links' => true]]); $this->assertEquals($this->user()->id, $response->json()['data']['id']); } }