Skip to content

Commit a3fce0d

Browse files
committed
Fix unit test
1 parent bba4de9 commit a3fce0d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Test/Unit/Validator/RequiredValidatorTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Loki\Components\Test\Unit\Validator;
44

55
use Loki\Components\Component\ComponentInterface;
6+
use Loki\Components\Util\Ajax;
67
use Loki\Components\Util\IsEmpty;
78
use PHPUnit\Framework\TestCase;
89
use Loki\Components\Validator\RequiredValidator;
@@ -12,8 +13,10 @@ class RequiredValidatorTest extends TestCase
1213
public function testWithNoSimpleValues(): void
1314
{
1415
$component = $this->createMock(ComponentInterface::class);
16+
$ajax = $this->createMock(Ajax::class);
17+
$ajax->method('isEmpty')->willReturn(true);
1518

16-
$validator = new RequiredValidator(new IsEmpty());
19+
$validator = new RequiredValidator(new IsEmpty(), $ajax);
1720
$this->assertTrue($validator->validate(1, $component));
1821
$this->assertIsArray($validator->validate(0, $component));
1922
$this->assertIsArray($validator->validate('', $component));

0 commit comments

Comments
 (0)