From 805be7d33155478ef32c4bd3643dcf4025d85a05 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 14 Jan 2016 20:18:13 -0500 Subject: Move validator methods --- tests/units/Validator/GroupValidatorTest.php | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/units/Validator/GroupValidatorTest.php (limited to 'tests/units/Validator/GroupValidatorTest.php') diff --git a/tests/units/Validator/GroupValidatorTest.php b/tests/units/Validator/GroupValidatorTest.php new file mode 100644 index 00000000..879f99ce --- /dev/null +++ b/tests/units/Validator/GroupValidatorTest.php @@ -0,0 +1,30 @@ +container); + + $result = $validator->validateCreation(array('name' => 'Test')); + $this->assertTrue($result[0]); + + $result = $validator->validateCreation(array('name' => '')); + $this->assertFalse($result[0]); + } + + public function testValidateModification() + { + $validator = new GroupValidator($this->container); + + $result = $validator->validateModification(array('name' => 'Test', 'id' => 1)); + $this->assertTrue($result[0]); + + $result = $validator->validateModification(array('name' => 'Test')); + $this->assertFalse($result[0]); + } +} -- cgit v1.2.3