* * For the full copyright and license information, please view the "LICENSE.md" * file that was distributed with this source code. */ namespace Respect\Validation; use PHPUnit\Framework\TestCase; use Respect\Validation\Exceptions\ComponentException; class ValidatorTest extends TestCase { public function testStaticCreateShouldReturnNewValidator() { $this->assertInstanceOf(Validator::class, Validator::create()); } public function testInvalidRuleClassShouldThrowComponentException() { $this->expectException(ComponentException::class); Validator::iDoNotExistSoIShouldThrowException(); } /** * Regression test #174. */ public function testShouldReturnValidatorInstanceWhenTheNotRuleIsCalledWithArguments() { $validator = new Validator(); $this->assertSame($validator, $validator->not($validator->notEmpty())); } }