packages/ztd-query-core/tests/Unit/Shadow/Mutation/Upsert/UpsertLiteralSourceTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Shadow\Mutation\Upsert;
6
7use PHPUnit\Framework\Attributes\CoversNothing;
8use PHPUnit\Framework\TestCase;
9use stdClass;
10use ZtdQuery\Shadow\Mutation\Upsert\UpsertLiteral;
11use ZtdQuery\Shadow\Mutation\UpsertExpression;
12use ZtdQuery\Shadow\Mutation\UpsertExpressionKind;
13
14#[CoversNothing]
15final class UpsertLiteralSourceTest extends TestCase
16{
17    public function testValueFlowsIntoAnExpressionWithoutCoercion(): void
18    {
19        $value = new stdClass();
20        $expression = new UpsertExpression(UpsertExpressionKind::Literal, new UpsertLiteral($value));
21
22        self::assertSame($value, $expression->evaluate([], [], 'users'));
23    }
24}
25