mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 08:04:03 +00:00
[4.x] Finish incomplete and missing tests (#947)
* complete test sqlite manager customize path * complete test seed command works * complete uniqe exists test * Update SingleDatabaseTenancyTest.php * refactor the ternary into if condition * custom path * simplify if condition * random dir name * Update SingleDatabaseTenancyTest.php * Update CommandsTest.php * prefix random DB name with custom_ Co-authored-by: Samuel Štancl <samuel@archte.ch>
This commit is contained in:
parent
ab5fa7a247
commit
8e3b74f9d1
4 changed files with 60 additions and 12 deletions
|
|
@ -207,13 +207,13 @@ test('the model returned by the tenant helper has unique and exists validation r
|
|||
$uniqueFails = Validator::make($data, [
|
||||
'slug' => 'unique:posts',
|
||||
])->fails();
|
||||
$existsFails = Validator::make($data, [
|
||||
$existsPass = Validator::make($data, [
|
||||
'slug' => 'exists:posts',
|
||||
])->fails();
|
||||
])->passes();
|
||||
|
||||
// Assert that 'unique' and 'exists' aren't scoped by default
|
||||
// pest()->assertFalse($uniqueFails); // todo get these two assertions to pass. for some reason, the validator is passing for both 'unique' and 'exists'
|
||||
// pest()->assertTrue($existsFails); // todo get these two assertions to pass. for some reason, the validator is passing for both 'unique' and 'exists'
|
||||
expect($uniqueFails)->toBeTrue(); // Expect unique rule failed to pass because slug 'foo' already exists
|
||||
expect($existsPass)->toBeTrue(); // Expect exists rule pass because slug 'foo' exists
|
||||
|
||||
$uniqueFails = Validator::make($data, [
|
||||
'slug' => tenant()->unique('posts'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue