packages/sql-semantics-mysql/tests/Unit/Statement/Expression/Problem/OperandColumnsTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Expression\Problem;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\MySql\Statement\Expression\Problem\OperandColumns;
11
12#[CoversClass(OperandColumns::class)]
13#[Small]
14final class OperandColumnsTest extends TestCase
15{
16 public function testMessageNamesBothWidths(): void
17 {
18 self::assertSame('Operand should contain 2 column(s), not 3.', (new OperandColumns(2, 3))->message());
19 }
20
21 public function testEqualWidthsAreRejected(): void
22 {
23 $this->expectExceptionMessage('An operand column problem names two different column counts.');
24
25 new OperandColumns(1, 1);
26 }
27}
28