Browse Source

Fixed 'accepted' validation rule, to show as required

Marcel Pociot 9 years ago
parent
commit
0aeacb5f0f
2 changed files with 2 additions and 1 deletions
  1. 1 0
      src/Mpociot/ApiDoc/ApiDocGenerator.php
  2. 1 1
      tests/ApiDocGeneratorTest.php

+ 1 - 0
src/Mpociot/ApiDoc/ApiDocGenerator.php

@@ -137,6 +137,7 @@ class ApiDocGenerator
                 $attributeData['required'] = true;
                 $attributeData['required'] = true;
                 break;
                 break;
             case 'accepted':
             case 'accepted':
+                $attributeData['required'] = true;
                 $attributeData['type'] = 'boolean';
                 $attributeData['type'] = 'boolean';
                 break;
                 break;
             case 'after':
             case 'after':

+ 1 - 1
tests/ApiDocGeneratorTest.php

@@ -79,7 +79,7 @@ class ApiDocGeneratorTest extends Orchestra\Testbench\TestCase
 
 
 
 
                 case 'accepted':
                 case 'accepted':
-                    $this->assertFalse( $attribute['required'] );
+                    $this->assertTrue( $attribute['required'] );
                     $this->assertEquals( 'boolean', $attribute['type'] );
                     $this->assertEquals( 'boolean', $attribute['type'] );
                     $this->assertCount( 0, $attribute['description'] );
                     $this->assertCount( 0, $attribute['description'] );
                     break;
                     break;