Skip to content

Commit 7b99db1

Browse files
committed
Fixed unit tests.
1 parent 9a9c95d commit 7b99db1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/unit/Fields/FileFieldTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ public function testConstruct()
2222

2323
/**
2424
* @expectedException PHPForm\Exceptions\ValidationError
25-
* @expectedExceptionMessage The submitted file is empty.
25+
* @expectedExceptionMessage This field is required.
2626
*/
2727
public function testValidateEmpty()
2828
{
2929
$data = array('size' => 0);
30-
$this->field->validate((object) $data);
30+
$field = new FileField(["max_size" => 20, "required" => true]);
31+
$field->validate((object) $data);
3132
}
3233

3334
/**

tests/unit/Validators/FileTypeValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class FileTypeValidatorTest extends TestCase
1111

1212
public function setUp()
1313
{
14-
$this->data = (object) array('type' => 'image/png');
14+
$this->data = (object) array('size' => 10, 'type' => 'image/png');
1515
}
1616

1717
public function testValidType()

0 commit comments

Comments
 (0)