-
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
type:bugBugBug
Description
Description
public function testWithTypecastingEdgeCase(): void
{
$this->dropTable('test');
$db = $this->getSharedConnection();
$db->createCommand()->createTable('test', [
'id' => PseudoType::PK,
'json_col' => ColumnBuilder::json(),
])->execute();
$db->createCommand()->insert('test', ['json_col' => ['a' => 1, 'b' => 2]])->execute();
$query = $db
->select([
't1.id as json_col',
't2.json_col',
])
->from('test t1')
->innerJoin('test t2', 't2.id = t1.id');
$this->assertSame(['json_col' => '{"a":1,"b":2}'], $query->one());
// Currently, `['json_col' => 0]` is here
$this->assertSame(['json_col' => ['a' => 1, 'b' => 2]], $query->withTypecasting()->one());
}Package version
2.0.0
PHP version
any
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type:bugBugBug