mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
🤖 Auto commit for release 'develop' on 2025-08-29
This commit is contained in:
@@ -47,17 +47,17 @@ final class RecurrenceControllerTest extends TestCase
|
||||
{
|
||||
for ($i = 1; $i <= $count; ++$i) {
|
||||
$recurrence = Recurrence::create([
|
||||
'user_id' => $user->id,
|
||||
'user_group_id' => $user->user_group_id,
|
||||
'transaction_type_id' => 1,
|
||||
'title' => 'Recurrence ' . $i,
|
||||
'description' => 'Recurrence ' . $i,
|
||||
'first_date' => today(),
|
||||
'apply_rules' => 1,
|
||||
'active' => 1,
|
||||
'repetitions' => 5,
|
||||
'user_id' => $user->id,
|
||||
'user_group_id' => $user->user_group_id,
|
||||
'transaction_type_id' => 1,
|
||||
'title' => 'Recurrence '.$i,
|
||||
'description' => 'Recurrence '.$i,
|
||||
'first_date' => today(),
|
||||
'apply_rules' => 1,
|
||||
'active' => 1,
|
||||
'repetitions' => 5,
|
||||
|
||||
]);
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ final class RecurrenceControllerTest extends TestCase
|
||||
public function testAuthenticatedCall(): void
|
||||
{
|
||||
// act as a user
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$response = $this->get(route('api.v1.autocomplete.recurring'), ['Accept' => 'application/json']);
|
||||
@@ -83,7 +83,7 @@ final class RecurrenceControllerTest extends TestCase
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItems(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRecurrences(5, $user);
|
||||
@@ -93,50 +93,50 @@ final class RecurrenceControllerTest extends TestCase
|
||||
$response->assertJsonCount(5);
|
||||
$response->assertJsonFragment(['name' => 'Recurrence 1']);
|
||||
$response->assertJsonStructure([
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItemsLimited(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRecurrences(5, $user);
|
||||
$response = $this->get(route('api.v1.autocomplete.recurring', [
|
||||
'query' => 'Recurrence',
|
||||
'limit' => 3,
|
||||
]), ['Accept' => 'application/json']);
|
||||
]), ['Accept' => 'application/json']);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertJsonCount(3);
|
||||
$response->assertJsonFragment(['name' => 'Recurrence 1']);
|
||||
$response->assertJsonStructure([
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItemsLots(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRecurrences(20, $user);
|
||||
$response = $this->get(route('api.v1.autocomplete.recurring', [
|
||||
'query' => 'Recurrence 1',
|
||||
'limit' => 20,
|
||||
]), ['Accept' => 'application/json']);
|
||||
]), ['Accept' => 'application/json']);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
|
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\integration\Api\Autocomplete;
|
||||
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\User;
|
||||
@@ -58,16 +57,16 @@ final class RuleControllerTest extends TestCase
|
||||
);
|
||||
for ($i = 1; $i <= $count; ++$i) {
|
||||
$rule = Rule::create([
|
||||
'user_id' => $user->id,
|
||||
'user_group_id' => $user->user_group_id,
|
||||
'rule_group_id' => $ruleGroup->id,
|
||||
'title' => 'Rule ' . $i,
|
||||
'description' => 'Rule ' . $i,
|
||||
'order' => 1,
|
||||
'active' => 1,
|
||||
'stop_processing' => 0,
|
||||
'strict' => 0,
|
||||
]);
|
||||
'user_id' => $user->id,
|
||||
'user_group_id' => $user->user_group_id,
|
||||
'rule_group_id' => $ruleGroup->id,
|
||||
'title' => 'Rule '.$i,
|
||||
'description' => 'Rule '.$i,
|
||||
'order' => 1,
|
||||
'active' => 1,
|
||||
'stop_processing' => 0,
|
||||
'strict' => 0,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +82,7 @@ final class RuleControllerTest extends TestCase
|
||||
public function testAuthenticatedCall(): void
|
||||
{
|
||||
// act as a user
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$response = $this->get(route('api.v1.autocomplete.rules'), ['Accept' => 'application/json']);
|
||||
@@ -93,7 +92,7 @@ final class RuleControllerTest extends TestCase
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItems(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRules(5, $user);
|
||||
@@ -103,50 +102,50 @@ final class RuleControllerTest extends TestCase
|
||||
$response->assertJsonCount(5);
|
||||
$response->assertJsonFragment(['name' => 'Rule 1']);
|
||||
$response->assertJsonStructure([
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItemsLimited(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRules(5, $user);
|
||||
$response = $this->get(route('api.v1.autocomplete.rules', [
|
||||
'query' => 'Rule',
|
||||
'limit' => 3,
|
||||
]), ['Accept' => 'application/json']);
|
||||
]), ['Accept' => 'application/json']);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertJsonCount(3);
|
||||
$response->assertJsonFragment(['name' => 'Rule 1']);
|
||||
$response->assertJsonStructure([
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItemsLots(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRules(20, $user);
|
||||
$response = $this->get(route('api.v1.autocomplete.rules', [
|
||||
'query' => 'Rule 1',
|
||||
'limit' => 20,
|
||||
]), ['Accept' => 'application/json']);
|
||||
]), ['Accept' => 'application/json']);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
|
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\integration\Api\Autocomplete;
|
||||
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -50,8 +49,8 @@ final class RuleGroupControllerTest extends TestCase
|
||||
[
|
||||
'user_id' => $user->id,
|
||||
'user_group_id' => $user->user_group_id,
|
||||
'title' => 'RuleGroup ' . $i,
|
||||
'description' => 'RuleGroup '. $i,
|
||||
'title' => 'RuleGroup '.$i,
|
||||
'description' => 'RuleGroup '.$i,
|
||||
'order' => 1,
|
||||
'active' => 1,
|
||||
'stop_processing' => 0,
|
||||
@@ -72,7 +71,7 @@ final class RuleGroupControllerTest extends TestCase
|
||||
public function testAuthenticatedCall(): void
|
||||
{
|
||||
// act as a user
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$response = $this->get(route('api.v1.autocomplete.rule-groups'), ['Accept' => 'application/json']);
|
||||
@@ -82,7 +81,7 @@ final class RuleGroupControllerTest extends TestCase
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItems(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRuleGroups(5, $user);
|
||||
@@ -92,50 +91,50 @@ final class RuleGroupControllerTest extends TestCase
|
||||
$response->assertJsonCount(5);
|
||||
$response->assertJsonFragment(['name' => 'RuleGroup 1']);
|
||||
$response->assertJsonStructure([
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItemsLimited(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRuleGroups(5, $user);
|
||||
$response = $this->get(route('api.v1.autocomplete.rule-groups', [
|
||||
'query' => 'RuleGroup',
|
||||
'limit' => 3,
|
||||
]), ['Accept' => 'application/json']);
|
||||
]), ['Accept' => 'application/json']);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertJsonCount(3);
|
||||
$response->assertJsonFragment(['name' => 'RuleGroup 1']);
|
||||
$response->assertJsonStructure([
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'active',
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItemsLots(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestRuleGroups(20, $user);
|
||||
$response = $this->get(route('api.v1.autocomplete.rule-groups', [
|
||||
'query' => 'RuleGroup 1',
|
||||
'limit' => 20,
|
||||
]), ['Accept' => 'application/json']);
|
||||
]), ['Accept' => 'application/json']);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
|
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\integration\Api\Autocomplete;
|
||||
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -50,8 +49,8 @@ final class TagControllerTest extends TestCase
|
||||
[
|
||||
'user_id' => $user->id,
|
||||
'user_group_id' => $user->user_group_id,
|
||||
'tag' => 'Tag ' . $i,
|
||||
'tag_mode' => 'nothing',
|
||||
'tag' => 'Tag '.$i,
|
||||
'tag_mode' => 'nothing',
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -69,7 +68,7 @@ final class TagControllerTest extends TestCase
|
||||
public function testAuthenticatedCall(): void
|
||||
{
|
||||
// act as a user
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$response = $this->get(route('api.v1.autocomplete.tags'), ['Accept' => 'application/json']);
|
||||
@@ -79,7 +78,7 @@ final class TagControllerTest extends TestCase
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItems(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestTags(5, $user);
|
||||
@@ -89,50 +88,50 @@ final class TagControllerTest extends TestCase
|
||||
$response->assertJsonCount(5);
|
||||
$response->assertJsonFragment(['name' => 'Tag 1']);
|
||||
$response->assertJsonStructure([
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'tag',
|
||||
],
|
||||
]);
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'tag',
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItemsLimited(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestTags(5, $user);
|
||||
$response = $this->get(route('api.v1.autocomplete.tags', [
|
||||
'query' => 'Tag',
|
||||
'limit' => 3,
|
||||
]), ['Accept' => 'application/json']);
|
||||
]), ['Accept' => 'application/json']);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertJsonCount(3);
|
||||
$response->assertJsonFragment(['name' => 'Tag 1']);
|
||||
$response->assertJsonStructure([
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'tag',
|
||||
],
|
||||
]);
|
||||
'*' => [
|
||||
'id',
|
||||
'name',
|
||||
'tag',
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWithItemsLots(): void
|
||||
{
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->createTestTags(20, $user);
|
||||
$response = $this->get(route('api.v1.autocomplete.tags', [
|
||||
'query' => 'Tag 1',
|
||||
'limit' => 20,
|
||||
]), ['Accept' => 'application/json']);
|
||||
]), ['Accept' => 'application/json']);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
|
Reference in New Issue
Block a user