コード例 #1
0
 /**
  * @test
  */
 public function filterForStringWithUnicodeCharactersAndSpacesWithAllowWhitespaceSetToFalseReturnsInputStringWithoutSpaces()
 {
     $input = 'My name contains äøüößØœ';
     $expected = 'MynamecontainsäøüößØœ';
     $this->fixture->setAllowWhiteSpace(FALSE);
     $this->assertSame($expected, $this->fixture->filter($input));
 }
コード例 #2
0
 /**
  * Returns TRUE if submitted value validates according to rule
  *
  * @return bool
  * @see \TYPO3\CMS\Form\Validation\ValidatorInterface::isValid()
  */
 public function isValid()
 {
     if ($this->requestHandler->has($this->fieldName)) {
         $value = $this->requestHandler->getByMethod($this->fieldName);
         if ($this->filter === NULL) {
             $this->filter = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Form\Filter\AlphabeticFilter::class);
         }
         $this->filter->setAllowWhiteSpace($this->allowWhiteSpace);
         if ($this->filter->filter($value) !== $value) {
             return FALSE;
         }
     }
     return TRUE;
 }