Skip to content

Commit 557e905

Browse files
committed
Style
1 parent d13c357 commit 557e905

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/database/migrations/create_team_user_table.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public function up(): void
1010
{
1111
Schema::create('team_user', function (Blueprint $table): void {
1212
$table->id();
13-
$table->foreignId('team_id')->constrained();
14-
$table->foreignId('user_id')->constrained();
15-
$table->string('role')->nullable();
13+
$table->foreignId('team_id')->constrained();
14+
$table->foreignId('user_id')->constrained();
15+
$table->string('role')->nullable();
1616
$table->timestamps();
1717
});
1818
}

tests/src/Support/Services/RelationshipJoinerTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
uses(TestCase::class);
1010

11-
it('can prepare query for no constraints', function () {
11+
it('can prepare query for no constraints for a BelongsToMany relationship', function () {
1212
$user = User::factory()->create();
1313

1414
expect($user->teams()->toBase())
@@ -72,7 +72,7 @@
7272
]);
7373

7474
$query = app(RelationshipJoiner::class)->prepareQueryForNoConstraints(
75-
$user->teams()->orderBy(new Expression("CASE WHEN role = 'some_other_role' THEN 1 ELSE 2 END"))
75+
$user->teams()->orderBy(new Expression("CASE WHEN role = 'some_other_role' THEN 1 ELSE 2 END"))
7676
);
7777

7878
expect($query->toBase())
@@ -81,8 +81,8 @@
8181
(new Team)->qualifyColumn('*'),
8282
"CASE WHEN role = 'user' THEN 1 ELSE 2 END", // Select added from `orderByRaw`...
8383
])
84-
->orders->toHaveCount(1)
85-
->and($query->toBase()->orders[0])
86-
->column->getValue($user->teams()->getGrammar())->toBe("CASE WHEN role = 'some_other_role' THEN 1 ELSE 2 END")
87-
->direction->toBe('asc');
84+
->orders->toHaveCount(1)
85+
->and($query->toBase()->orders[0])
86+
->column->getValue($user->teams()->getGrammar())->toBe("CASE WHEN role = 'some_other_role' THEN 1 ELSE 2 END")
87+
->direction->toBe('asc');
8888
});

0 commit comments

Comments
 (0)