/**
  * Test for getSenderNameFromArguments()
  *
  * @param array $values
  * @param string $fallback
  * @param string $defaultMailFromAddress
  * @param string $expectedResult
  * @return void
  * @dataProvider getSenderNameFromArgumentsReturnsStringDataProvider
  * @test
  */
 public function getSenderNameFromArgumentsReturnsString($values, $fallback, $defaultMailFromAddress, $expectedResult)
 {
     $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName'] = $defaultMailFromAddress;
     $mail = new Mail();
     if (is_array($values)) {
         foreach ($values as $value) {
             $answer = new Answer();
             $answer->_setProperty('translateFormat', 'Y-m-d');
             $answer->_setProperty('valueType', is_array($values) ? 2 : 0);
             $field = new Field();
             $field->setType('input');
             $field->setSenderName(true);
             $answer->_setProperty('value', $value);
             $answer->setValueType(is_array($value) ? 1 : 0);
             $answer->setField($field);
             $mail->addAnswer($answer);
         }
     }
     $result = $this->generalValidatorMock->_callRef('getSenderNameFromArguments', $mail, $fallback);
     $this->assertSame($expectedResult, $result);
 }
 /**
  * Test for blacklistStringCheck()
  *
  * @param int $spamIndicator
  * @param array $answerProperties
  * @param string $blacklist
  * @param int $expectedOverallSpamIndicator
  * @return void
  * @dataProvider blacklistStringCheckReturnsVoidDataProvider
  * @test
  */
 public function blacklistStringCheckReturnsVoid($spamIndicator, $answerProperties, $blacklist, $expectedOverallSpamIndicator)
 {
     $mail = new Mail();
     foreach ($answerProperties as $value) {
         $answer = new Answer();
         $answer->setValueType(123);
         $answer->setValue($value);
         $mail->addAnswer($answer);
     }
     $this->generalValidatorMock->_set('settings', ['spamshield.' => ['indicator.' => ['blacklistStringValues' => $blacklist]]]);
     $this->generalValidatorMock->_callRef('blacklistStringCheck', $mail, $spamIndicator);
     $this->assertSame($expectedOverallSpamIndicator, $this->generalValidatorMock->_callRef('getSpamIndicator'));
 }