/** * Testing instance of input filter. */ public function testInstanceInputFilter() { $signInForm = new SignInForm(); $signInForm->setInputFilter(new SignInFilter()); $this->assertInstanceOf(SignInFilter::class, $signInForm->getInputFilter()); $signInForm->setValues([]); $this->assertFalse($signInForm->isValid()); }
/** * Testing error hints. */ public function testErrorHints() { $signInForm = new SignInForm(); $signInForm->setValues(['email' => 'test@gmail.co2m', 'password' => '12q34e56t78']); $this->assertFalse($signInForm->isValid()); $errorStorage = new ErrorStorage($signInForm->getErrors()); $this->assertTrue($errorStorage->hasError('email')); $this->assertFalse(empty($errorStorage->getError('email'))); $this->assertFalse($errorStorage->hasError('password')); $this->assertEquals(null, $errorStorage->getError('password')); }