Skip to content

Commit

Permalink
Fixes and revert to the old testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Alymosul committed Mar 13, 2018
1 parent 0252d09 commit 475c138
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Validation/Rules/Unique.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Unique
*
* @var string
*/
protected $idColumn;
protected $idColumn = 'id';

/**
* Ignore the given ID during the unique check.
Expand Down Expand Up @@ -67,7 +67,7 @@ public function __toString()
$this->table,
$this->column,
$this->ignore ? '"'.$this->ignore.'"' : 'NULL',
$this->idColumn ?? 'NULL',
$this->idColumn,
$this->formatWheres()
), ',');
}
Expand Down
1 change: 0 additions & 1 deletion tests/Support/framework/testing/disks/testing/letter.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Validation/ValidationUniqueRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function testItCorrectlyFormatsAStringVersionOfTheRule()
{
$rule = new \Illuminate\Validation\Rules\Unique('table');
$rule->where('foo', 'bar');
$this->assertEquals('unique:table,NULL,NULL,NULL,foo,bar', (string) $rule);
$this->assertEquals('unique:table,NULL,NULL,id,foo,bar', (string) $rule);

$rule = new \Illuminate\Validation\Rules\Unique('table', 'column');
$rule->ignore('Taylor, Otwell', 'id_column');
Expand Down

0 comments on commit 475c138

Please sign in to comment.