29 lines
896 B
PHP
29 lines
896 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace PhpQml\Bridge\Tests;
|
||
|
|
|
||
|
|
use PhpQml\Bridge\BridgeOp;
|
||
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
||
|
|
use PHPUnit\Framework\TestCase;
|
||
|
|
|
||
|
|
#[CoversClass(BridgeOp::class)]
|
||
|
|
final class BridgeOpTest extends TestCase
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* The four cases are the bridge's wire-format envelope `op` tokens
|
||
|
|
* (PLAN.md §4). QML clients hardcode the strings — renaming an enum
|
||
|
|
* case is a backwards-compatible PHP-side refactor, but renaming a
|
||
|
|
* `value` is not. This test fails the build before such a rename
|
||
|
|
* ships.
|
||
|
|
*/
|
||
|
|
public function testWireFormatValuesMatchDocumentedTokens(): void
|
||
|
|
{
|
||
|
|
self::assertSame('upsert', BridgeOp::Upsert->value);
|
||
|
|
self::assertSame('delete', BridgeOp::Delete->value);
|
||
|
|
self::assertSame('replace', BridgeOp::Replace->value);
|
||
|
|
self::assertSame('event', BridgeOp::Event->value);
|
||
|
|
}
|
||
|
|
}
|