From 4ebe8f4f0f72c4c759fd7f516f412cc9ae2e9d72 Mon Sep 17 00:00:00 2001
From: czechmarcin <czechmarcin@hotmail.com>
Date: Wed, 15 May 2019 13:31:45 +0200
Subject: [PATCH] EZP-30417: Add notifications to the password reset view
 (#288)

---
 lib/Validator/Constraints/Password.php                     | 7 +++++--
 .../RepositoryForms/Validator/Constraints/PasswordTest.php | 2 +-
 .../Validator/Constraints/UserAccountPasswordTest.php      | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/Validator/Constraints/Password.php b/lib/Validator/Constraints/Password.php
index 590e8b689..8ce60df98 100644
--- a/lib/Validator/Constraints/Password.php
+++ b/lib/Validator/Constraints/Password.php
@@ -6,6 +6,9 @@
 
 use Symfony\Component\Validator\Constraint;
 
+/**
+ * @Annotation
+ */
 class Password extends Constraint
 {
     /** @var string */
@@ -17,8 +20,8 @@ class Password extends Constraint
     /**
      * {@inheritdoc}
      */
-    public function getTargets(): string
+    public function getTargets(): array
     {
-        return self::CLASS_CONSTRAINT;
+        return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT];
     }
 }
diff --git a/tests/RepositoryForms/Validator/Constraints/PasswordTest.php b/tests/RepositoryForms/Validator/Constraints/PasswordTest.php
index c707937ac..b4f755609 100644
--- a/tests/RepositoryForms/Validator/Constraints/PasswordTest.php
+++ b/tests/RepositoryForms/Validator/Constraints/PasswordTest.php
@@ -30,6 +30,6 @@ public function testValidatedBy()
 
     public function testGetTargets()
     {
-        $this->assertSame(Password::CLASS_CONSTRAINT, $this->constraint->getTargets());
+        $this->assertSame([Password::CLASS_CONSTRAINT, Password::PROPERTY_CONSTRAINT], $this->constraint->getTargets());
     }
 }
diff --git a/tests/RepositoryForms/Validator/Constraints/UserAccountPasswordTest.php b/tests/RepositoryForms/Validator/Constraints/UserAccountPasswordTest.php
index e010f0244..7cdd7e1eb 100644
--- a/tests/RepositoryForms/Validator/Constraints/UserAccountPasswordTest.php
+++ b/tests/RepositoryForms/Validator/Constraints/UserAccountPasswordTest.php
@@ -30,6 +30,6 @@ public function testValidatedBy()
 
     public function testGetTargets()
     {
-        $this->assertSame(UserAccountPassword::CLASS_CONSTRAINT, $this->constraint->getTargets());
+        $this->assertSame([UserAccountPassword::CLASS_CONSTRAINT, UserAccountPassword::PROPERTY_CONSTRAINT], $this->constraint->getTargets());
     }
 }