Skip to content

Commit

Permalink
Various fix
Browse files Browse the repository at this point in the history
  • Loading branch information
clagiordano committed Sep 10, 2016
1 parent 4ec189f commit 8109e38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace clagiordano\weblibs\validator;

use ErrorHandler;
use clagiordano\weblibs\validator\ErrorHandler;

/**
*
Expand Down Expand Up @@ -53,8 +53,8 @@ protected function doValidate($field, $value, $rules)
foreach ($rules as $rule => $satisfier) {
$validatorFunction = 'validate' . $this->allowedValidator[$rule];

if (!is_callable($this->{$validatorFunction}) {
call_user_func()
if (!is_callable($this->{$validatorFunction})) {
//call_user_func()
}
}
}
Expand Down
23 changes: 22 additions & 1 deletion tests/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

namespace clagiordano\weblibs\validator\tests;

use clagiordano\weblibs\validator\ErrorHandler;
use clagiordano\weblibs\validator\Validator;

/**
* Class ValidatorTest
* @package clagiordano\weblibs\validator\tests
*/
class ValidatorTest extends \PHPUnit_Framework_TestCase
{
/** @var ErrorHandler $errorhandler */
private $errorHandler = null;
/** @var Validator $validator */
private $validator = null;

Expand Down Expand Up @@ -38,10 +42,27 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase
public function setUp()
{

/**
* Create a new errorhandler object
**/
$this->errorHandler = new ErrorHandler();
$this->assertInstanceOf(
'clagiordano\weblibs\validator\ErrorHandler',
$this->errorHandler
);

/**
* Create a new validator object
**/
$this->validator = new Application();
$this->validator = new Validator($this->errorHandler);
$this->assertInstanceOf(
'clagiordano\weblibs\validator\Validator',
$this->validator
);
}

public function testTest()
{

}
}

0 comments on commit 8109e38

Please sign in to comment.