2020-10-22 08:46:02 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-10-22 08:46:02 +02:00
|
|
|
*
|
2022-06-21 11:57:17 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2020-10-22 08:46:02 +02:00
|
|
|
*/
|
2022-06-21 11:57:17 +02:00
|
|
|
|
2020-10-22 08:46:02 +02:00
|
|
|
namespace Tests\Feature;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
2020-11-25 15:19:52 +01:00
|
|
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
2020-10-22 08:46:02 +02:00
|
|
|
use Tests\MockAccountData;
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
* @covers App\Http\Controllers\ActivityController
|
|
|
|
*/
|
|
|
|
class ActivityApiTest extends TestCase
|
|
|
|
{
|
|
|
|
use DatabaseTransactions;
|
|
|
|
use MockAccountData;
|
|
|
|
|
2022-06-21 12:00:57 +02:00
|
|
|
protected function setUp() :void
|
2020-10-22 08:46:02 +02:00
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$this->makeTestData();
|
|
|
|
|
2020-10-22 12:14:14 +02:00
|
|
|
$this->withoutMiddleware(
|
|
|
|
ThrottleRequests::class
|
|
|
|
);
|
2020-10-22 08:46:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testActivityGet()
|
|
|
|
{
|
|
|
|
$response = $this->withHeaders([
|
2022-06-21 11:57:17 +02:00
|
|
|
'X-API-SECRET' => config('ninja.api_secret'),
|
|
|
|
'X-API-TOKEN' => $this->token,
|
|
|
|
])->get('/api/v1/activities/');
|
2020-10-22 08:46:02 +02:00
|
|
|
|
|
|
|
$response->assertStatus(200);
|
|
|
|
}
|
2023-01-22 05:03:23 +01:00
|
|
|
|
|
|
|
public function testActivityGetWithReact()
|
|
|
|
{
|
|
|
|
$response = $this->withHeaders([
|
|
|
|
'X-API-SECRET' => config('ninja.api_secret'),
|
|
|
|
'X-API-TOKEN' => $this->token,
|
|
|
|
])->get('/api/v1/activities?react=true');
|
|
|
|
|
|
|
|
$response->assertStatus(200);
|
|
|
|
}
|
|
|
|
|
2020-10-22 08:46:02 +02:00
|
|
|
}
|