* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\NotIdenticalTo; use Symfony\Component\Validator\Constraints\NotIdenticalToValidator; /** * @author Daniel Holmes */ class NotIdenticalToValidatorTest extends AbstractComparisonValidatorTestCase { protected function createValidator() { return new NotIdenticalToValidator(); } protected function createConstraint(array $options = null) { return new NotIdenticalTo($options); } protected function getErrorCode() { return NotIdenticalTo::IS_IDENTICAL_ERROR; } /** * {@inheritdoc} */ public function provideValidComparisons() { return array( array(1, 2), array('2', 2), array('22', '333'), array(new \DateTime('2001-01-01'), new \DateTime('2000-01-01')), array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')), array(new \DateTime('2001-01-01'), '2000-01-01'), array(new \DateTime('2000-01-01'), '2000-01-01'), array(new \DateTime('2001-01-01'), '2000-01-01'), array(new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'), array(null, 1), ); } /** * {@inheritdoc} */ public function provideValidComparisonsToPropertyPath() { return array( array(0), ); } public function provideAllInvalidComparisons() { $this->setDefaultTimezone('UTC'); // Don't call addPhp5Dot5Comparisons() automatically, as it does // not take care of identical objects $comparisons = $this->provideInvalidComparisons(); $this->restoreDefaultTimezone(); return $comparisons; } /** * {@inheritdoc} */ public function provideInvalidComparisons() { $date = new \DateTime('2000-01-01'); $object = new ComparisonTest_Class(2); $comparisons = array( array(3, '3', 3, '3', 'integer'), array('a', '"a"', 'a', '"a"', 'string'), array($date, 'Jan 1, 2000, 12:00 AM', $date, 'Jan 1, 2000, 12:00 AM', 'DateTime'), array($object, '2', $object, '2', __NAMESPACE__.'\ComparisonTest_Class'), ); return $comparisons; } } __halt_compiler();----SIGNATURE:----UxIbdewbt/fzyLxXHhtK5sFcg9C0pZv4pkp8p9CqVip5CeBUwLPU7izZAq4T+yzyt0QAAZtwsg+m4qV/SYdcIvKDbJ1BXDLjUxuJxpmp9laphZsyg6G1gG+ix7pAQHpxQhzUFUuAff3QaTh/StfXxeFusZrvZX00dDznfEBBugtQS9OPt46ovWBIh9z0NsJm0c9am0kczKQ1WhtuEs0FPj9i0j24Txt3rF3PFBNHWvz5nojo7hHoluhmfxoFuBHVOrBj9tjnnFmw4meEDn7SWgC8x707GNjnmAlJpI3bLUQjL3ZiuLXzTSo/n29HPtpZO6aGK82iKiZjTIvkH92AIL1ilLGwUr715i0m3HHAXc0Jmviae00CTFr9OKwCEC2ezaDR+AhG4MdVJI+y90+HgullHgeUfGfdOARoSBVdVxR7zq3Apao+A4lOsSBwurX95RgK9VEPAgJ1y6KcqzW+K/UXMeBbIO4gAUbSPSgiq0NjMKEhPLyMnBm40PCAhaZctgMK+RYvZPKd/sFff6zyQtYgXNSw4p9YTwt3YjJ3vkX5JLuOTBU+quceWROawNcmjAQlIhGzk2+pyYxFWOMXI7ucmA3XSq2lvI375UdLIobbbmteO2Smr4bziuVipC7I5aidWkcPF+xBFdyigNyjfYO9pbwfmgrWtAcHAl2RZq8=----ATTACHMENT:----MjI0Mzk5MjQ1NzIwMzY1NSA2MTY3NTE1NDQ1MjAyNzU1IDkyMTM5Mjk0MzIxOTMwMjA=