-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9fd0b0
commit d5f9167
Showing
1 changed file
with
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace ipl\Tests\Html\FormElement; | ||
|
||
use ipl\Html\FormElement\FileElement; | ||
use ipl\Tests\Html\TestCase; | ||
|
||
class FileElementTest extends TestCase | ||
{ | ||
public function testFileElement() | ||
{ | ||
$file = new FileElement('elname'); | ||
|
||
$this->assertHtml('<input name="elname" type="file"/>', $file); | ||
} | ||
|
||
public function testMultipleAttribute() | ||
{ | ||
$file = new FileElement('elname', ['multiple' => true]); | ||
|
||
$this->assertHtml('<input multiple name="elname[]" type="file"/>', $file); | ||
} | ||
|
||
public function testAcceptAttribute() | ||
{ | ||
$file = new FileElement('elname', ['accept' => 'image/jpeg, image/png']); | ||
|
||
$this->assertHtml('<input name="elname" type="file" accept="image/jpeg, image/png"/>', $file); | ||
} | ||
|
||
public function testSetValueDoesNotEffectAnything() | ||
{ | ||
$file = new FileElement('elname'); | ||
|
||
$this->assertHtml('<input name="elname" type="file"/>', $file); | ||
|
||
$file->setValue('test'); | ||
$this->assertHtml('<input name="elname" type="file"/>', $file); | ||
} | ||
} |