Skip to content

Commit

Permalink
query db compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-w committed Feb 20, 2025
1 parent 5da3eff commit f733f11
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/Integration/Database/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,13 @@ public function testPluck()
], DB::table('posts')->pluck('title', 'content')->toArray());

// Test custom select query before calling pluck.
$this->assertSame(
[2, 2],
DB::table('posts')
->selectSub(DB::table('posts')->selectRaw('COUNT(*)'), 'total_posts_count')
->pluck('total_posts_count')
->toArray(),
);
$result = DB::table('posts')
->selectSub(DB::table('posts')->selectRaw('COUNT(*)'), 'total_posts_count')
->pluck('total_posts_count')
->toArray();
// Cast for database compatibility.
$this->assertSame(2, (int) $result[0]);
$this->assertSame(2, (int) $result[1]);
}

public function testFetchUsing()
Expand Down

0 comments on commit f733f11

Please sign in to comment.