1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Query\Processors\PostgresProcessor;
use PHPUnit\Framework\TestCase;
class DatabasePostgresProcessorTest extends TestCase
{
public function testProcessColumnListing()
{
$processor = new PostgresProcessor;
$listing = [['column_name' => 'id'], ['column_name' => 'name'], ['column_name' => 'email']];
$expected = ['id', 'name', 'email'];
$this->assertEquals($expected, $processor->processColumnListing($listing));
// convert listing to objects to simulate PDO::FETCH_CLASS
foreach ($listing as &$row) {
$row = (object) $row;
}
$this->assertEquals($expected, $processor->processColumnListing($listing));
}
}
|