Skip to content

Commit

Permalink
add supporting test (#38179)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahinkle committed Jul 30, 2021
1 parent 7049025 commit 43b08f8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Validation/ValidationUniqueRuleTest.php
Expand Up @@ -81,6 +81,17 @@ public function testItCorrectlyFormatsAStringVersionOfTheRule()
$rule->where('foo', '"bar"');
$this->assertSame('unique:table,NULL,NULL,id,foo,"""bar"""', (string) $rule);
}

public function testItIgnoresSoftDeletes()
{
$rule = new Unique('table');
$rule->withoutTrashed();
$this->assertSame('unique:table,NULL,NULL,id,deleted_at,"NULL"', (string) $rule);

$rule = new Unique('table');
$rule->withoutTrashed('softdeleted_at');
$this->assertSame('unique:table,NULL,NULL,id,softdeleted_at,"NULL"', (string) $rule);
}
}

class EloquentModelStub extends Model
Expand Down

0 comments on commit 43b08f8

Please sign in to comment.