Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
more code
Browse files Browse the repository at this point in the history
  • Loading branch information
bupy7 committed Aug 26, 2016
1 parent 7d34957 commit 99b43c4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Asset/EmptyForm.php
Expand Up @@ -6,6 +6,8 @@

/**
* Empty form.
* @author Belosludcev Vasilij <https://github.com/bupy7>
* @since 1.0.0
*/
class EmptyForm extends FormAbstract
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Asset/SignInFilter.php
Expand Up @@ -6,6 +6,8 @@

/**
* Input filter of signin.
* @author Belosludcev Vasilij <https://github.com/bupy7>
* @since 1.0.0
*/
class SignInFilter extends InputFilter
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Asset/SignInForm.php
Expand Up @@ -6,6 +6,8 @@

/**
* Form of signin.
* @author Belosludcev Vasilij <https://github.com/bupy7>
* @since 1.0.0
*/
class SignInForm extends FormAbstract
{
Expand Down
32 changes: 32 additions & 0 deletions tests/ErrorStorage/ErrorStorageTest.php
@@ -0,0 +1,32 @@
<?php

namespace Bupy7\Form\Tests\ErrorStorage;

use PHPUnit_Framework_TestCase;
use Bupy7\Form\Tests\Asset\SignInForm;
use Bupy7\Form\ErrorStorage\ErrorStorage;

/**
* @author Vasilij Belosludcev <https://github.com/bupy7>
* @since 1.0.0
*/
class FormAstractTest extends PHPUnit_Framework_TestCase
{
/**
* 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->assertTrue(!empty($errorStorage->getError('email')));
}
}

0 comments on commit 99b43c4

Please sign in to comment.