feat(test): add multi-engine integration matrix
This commit is contained in:
20
tests/Models/Post.php
Normal file
20
tests/Models/Post.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Models;
|
||||
|
||||
use Libs\Model;
|
||||
|
||||
/**
|
||||
* Post - DuckBrain test fixture
|
||||
*
|
||||
* Second table of the integration matrix, joined to Users through user_id.
|
||||
* Column names avoid SQL reserved words on every engine.
|
||||
*/
|
||||
final class Post extends Model
|
||||
{
|
||||
public ?int $id;
|
||||
public ?int $userId;
|
||||
public string $title;
|
||||
public ?string $content;
|
||||
public ?float $rating;
|
||||
}
|
||||
26
tests/Models/User.php
Normal file
26
tests/Models/User.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Models;
|
||||
|
||||
use DateTime;
|
||||
use Libs\Model;
|
||||
|
||||
/**
|
||||
* User - DuckBrain test fixture
|
||||
*
|
||||
* Public model used by the integration matrix. $id is declared WITHOUT a
|
||||
* default so it stays uninitialized until the database assigns it:
|
||||
* Model::getVars() skips uninitialized typed properties, which lets
|
||||
* AUTOINCREMENT / AUTO_INCREMENT / SERIAL generate the primary key and
|
||||
* Model::add() assign it back to the instance.
|
||||
*/
|
||||
final class User extends Model
|
||||
{
|
||||
public ?int $id;
|
||||
public string $username;
|
||||
public ?string $email;
|
||||
public ?string $bio;
|
||||
public ?int $age;
|
||||
public bool $isActive = false;
|
||||
public ?DateTime $lastLogin;
|
||||
}
|
||||
Reference in New Issue
Block a user