forked from dustin10/VichUploaderBundle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
throw exception if required attributes of UploadableField are not pre…
…sent and tests
- Loading branch information
Showing
2 changed files
with
37 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,33 @@ | ||
<?php | ||
|
||
namespace Vich\UploaderBundle\Tests\Mapping\Annotation; | ||
|
||
use Vich\UploaderBundle\Mapping\Annotation\UploadableField; | ||
|
||
/** | ||
* UploadableFieldTest. | ||
* | ||
* @author Dustin Dobervich <ddobervich@gmail.com> | ||
*/ | ||
class UploadableFieldTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @expectedException \Exception | ||
*/ | ||
public function testExceptionThrownWhenNoMappingAttribute() | ||
{ | ||
new UploadableField(array( | ||
'fileNameProperty' => 'fileName' | ||
)); | ||
} | ||
|
||
/** | ||
* @expectedException \Exception | ||
*/ | ||
public function testExceptionThrownWhenNoFileNamePropertyAttribute() | ||
{ | ||
new UploadableField(array( | ||
'mapping' => 'file' | ||
)); | ||
} | ||
} |