mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 02:54:03 +00:00
Correct terminology in table manager test file
This commit is contained in:
parent
9b34a8cdf3
commit
fbbe697500
1 changed files with 4 additions and 4 deletions
|
|
@ -336,7 +336,7 @@ test('queries are correctly scoped using RLS', function (
|
||||||
expect(fn () => DB::statement("INSERT INTO notes (text, comment_id) VALUES ('baz', {$post1Comment->id})"))
|
expect(fn () => DB::statement("INSERT INTO notes (text, comment_id) VALUES ('baz', {$post1Comment->id})"))
|
||||||
->toThrow(QueryException::class);
|
->toThrow(QueryException::class);
|
||||||
})->with(['forceRls is true' => true, 'forceRls is false' => false])
|
})->with(['forceRls is true' => true, 'forceRls is false' => false])
|
||||||
->with(['comment constraint' => true, 'real constraint' => false]);
|
->with(['comment constraint' => true, 'foreign key constraint' => false]);
|
||||||
|
|
||||||
test('table rls manager generates shortest paths that lead to the tenants table correctly', function (bool $scopeByDefault) {
|
test('table rls manager generates shortest paths that lead to the tenants table correctly', function (bool $scopeByDefault) {
|
||||||
TableRLSManager::$scopeByDefault = $scopeByDefault;
|
TableRLSManager::$scopeByDefault = $scopeByDefault;
|
||||||
|
|
@ -684,7 +684,7 @@ test('table manager throws an exception when the only generated paths lead throu
|
||||||
// Add another recursive relationship to demonstrate a more complex case
|
// Add another recursive relationship to demonstrate a more complex case
|
||||||
$table->foreignId('related_post_id')->comment('rls recursive_posts.id');
|
$table->foreignId('related_post_id')->comment('rls recursive_posts.id');
|
||||||
|
|
||||||
// Add a foreign key with constraint to the current table (= self-referencing constraint)
|
// Add a foreign key to the current table (= self-referencing constraint)
|
||||||
$table->foreignId('parent_comment_id')->comment('rls recursive_comments.id');
|
$table->foreignId('parent_comment_id')->comment('rls recursive_comments.id');
|
||||||
|
|
||||||
// Add tenant_id to break the recursion - RecursiveRelationshipException should not be thrown
|
// Add tenant_id to break the recursion - RecursiveRelationshipException should not be thrown
|
||||||
|
|
@ -736,12 +736,12 @@ test('table manager can generate paths leading through comment constraint column
|
||||||
|
|
||||||
Schema::create('non_constrained_users', function (Blueprint $table) {
|
Schema::create('non_constrained_users', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('tenant_id')->comment('rls tenants.id'); // comment constraint
|
$table->string('tenant_id')->comment('rls tenants.id'); // Comment constraint
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('non_constrained_posts', function (Blueprint $table) {
|
Schema::create('non_constrained_posts', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('author_id')->comment('rls non_constrained_users.id'); // comment constraint
|
$table->foreignId('author_id')->comment('rls non_constrained_users.id'); // Comment constraint
|
||||||
});
|
});
|
||||||
|
|
||||||
/** @var TableRLSManager $manager */
|
/** @var TableRLSManager $manager */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue