Skip to content

Commit

Permalink
Add custom file macro method test case
Browse files Browse the repository at this point in the history
  • Loading branch information
curder committed Jun 12, 2024
1 parent 5fca9b5 commit 6e94084
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/others/macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,22 @@ public function store($request)
// ...
}
```


```php [测试]
/**
* @throws ReflectionException
*/
it('has custom types when using document macro', function () {

$file = (new \Illuminate\Validation\Rules\File())->document();

$types = ['pdf', 'rtf', 'doc', 'docx'];
$allowedMimetypes = (new ReflectionClass($file))->getProperty('allowedMimetypes')->getValue($file);

expect($allowedMimetypes)->toEqual($types);
});
```
:::

### `Carbon`
Expand Down

0 comments on commit 6e94084

Please sign in to comment.