File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33namespace Loki \Components \Test \Unit \Validator ;
44
55use Loki \Components \Component \ComponentInterface ;
6+ use Loki \Components \Util \Ajax ;
67use Loki \Components \Util \IsEmpty ;
78use PHPUnit \Framework \TestCase ;
89use 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 ));
You can’t perform that action at this time.
0 commit comments