-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API allow chaining for Upload_Validator
- Loading branch information
1 parent
6c7a971
commit 595c5a5
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Assets\Tests; | ||
|
||
use SilverStripe\Dev\SapphireTest; | ||
use SilverStripe\Assets\Upload_Validator; | ||
|
||
/** | ||
* @skipUpgrade | ||
*/ | ||
class UploadValidatorTest extends SapphireTest | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
* @var bool | ||
*/ | ||
protected $usesDatabase = false; | ||
|
||
public function testUploadValidatorChaining() | ||
{ | ||
$v = new Upload_Validator(); | ||
|
||
$chain = $v->clearErrors()->setAllowedMaxFileSize(100)->setAllowedExtensions([ | ||
'jpg' | ||
]); | ||
|
||
$this->assertInstanceOf(Upload_Validator::class, $chain); | ||
} | ||
} |