Skip to content

Commit

Permalink
separate raw test
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-w committed Nov 1, 2023
1 parent 8257a26 commit ac062be
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tests/Integration/Database/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,6 @@ public function testPluck(string $pluckFn): void
'Lorem Ipsum.' => 'Bar Post',
], DB::table('posts')->$pluckFn('title', 'content')->toArray());

// Test custom query calculations.
$this->assertSame([
2 => 'FOO POST',
4 => 'BAR POST',
], DB::table('posts')->$pluckFn(
DB::raw('UPPER(title)'),
DB::raw('2 * id')
)->toArray());

// Test null and empty string as key.
$this->assertSame([
'science' => 'Lorem Ipsum b.',
Expand Down Expand Up @@ -497,4 +488,16 @@ public static function pluckProvider(): array
['pluckPDO'],
];
}

public function testPluckPDORawExpressions(): void
{
// Test custom query calculations.
$this->assertSame([
2 => 'FOO POST',
4 => 'BAR POST',
], DB::table('posts')->pluckPDO(
DB::raw('UPPER(title)'),
DB::raw('2 * id')
)->toArray());
}
}

0 comments on commit ac062be

Please sign in to comment.