Skip to content

Commit

Permalink
[TASK] Finishs unit tests
Browse files Browse the repository at this point in the history
Uses a helper variable to deactivate flashmessage saving in session
which does not exist in phpunit

Change-Id: Ic302dab9d3ca849647cbcaebc0687915ec472830
  • Loading branch information
spoonerWeb committed Dec 8, 2016
1 parent 1196990 commit 1ae37a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Classes/Evaluation/PasswordEvaluator.php
Expand Up @@ -42,9 +42,10 @@ public function returnFieldJS()
* @param mixed $value The value that has to be checked.
* @param string $is_in Is-In String
* @param integer $set Determines if the field can be set (value correct) or not
* @param boolean $storeFlashMessageInSession Used only for phpunit issues
* @return string The new value of the field
*/
public function evaluateFieldValue($value, $is_in, &$set)
public function evaluateFieldValue($value, $is_in, &$set, $storeFlashMessageInSession = true)
{
// if $value is a md5 hash, return the value directly
if ($this->isMd5($value) || $this->isSalted($value)) {
Expand Down Expand Up @@ -164,7 +165,7 @@ public function evaluateFieldValue($value, $is_in, &$set)
implode(LF, $messages),
$languageService->getLL('messageTitle'),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
true
$storeFlashMessageInSession
)
);

Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Evaluation/PasswordEvaluatorTest.php
Expand Up @@ -148,7 +148,7 @@ public function checkForInvalidPassword(array $configuration, $password)
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_secure_pw'] = serialize($configuration);
self::assertEquals(
'',
$this->subject->evaluateFieldValue($password, '', $set)
$this->subject->evaluateFieldValue($password, '', $set, false)
);
}

Expand Down

0 comments on commit 1ae37a6

Please sign in to comment.