Skip to content

Commit

Permalink
Fixed 'accepted' validation rule, to show as required
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed May 12, 2016
1 parent 5ef727e commit 0aeacb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Mpociot/ApiDoc/ApiDocGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ protected function parseRule($rule, &$attributeData)
$attributeData['required'] = true;
break;
case 'accepted':
$attributeData['required'] = true;
$attributeData['type'] = 'boolean';
break;
case 'after':
Expand Down
2 changes: 1 addition & 1 deletion tests/ApiDocGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testCanParseFormRequestRules()


case 'accepted':
$this->assertFalse( $attribute['required'] );
$this->assertTrue( $attribute['required'] );
$this->assertEquals( 'boolean', $attribute['type'] );
$this->assertCount( 0, $attribute['description'] );
break;
Expand Down

0 comments on commit 0aeacb5

Please sign in to comment.