コード例 #1
0
 /**
  * @test
  */
 public function filterForStringWithUnicodeCharactersAndSpacesWithAllowWhitespaceSetToFalseReturnsInputStringWithoutSpaces()
 {
     $input = 'My name contains äøüößØœ';
     $inputWithoutSpaces = 'MynamecontainsäøüößØœ';
     $this->fixture->setAllowWhiteSpace(FALSE);
     $this->assertSame($inputWithoutSpaces, $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\AlphanumericFilter::class);
         }
         $this->filter->setAllowWhiteSpace($this->allowWhiteSpace);
         if ($this->filter->filter($value) !== $value) {
             return FALSE;
         }
     }
     return TRUE;
 }
コード例 #3
0
 /**
  * @test
  */
 public function filterAllowsNumericCharacters()
 {
     $this->assertSame('foo23bar', $this->fixture->filter('foo23bar'));
 }