/** * @test */ public function filterForStringWithUnicodeCharactersAndSpacesWithAllowWhitespaceSetToFalseReturnsInputStringWithoutSpaces() { $input = 'My name contains äøüößØœ'; $expected = 'MynamecontainsäøüößØœ'; $this->fixture->setAllowWhiteSpace(FALSE); $this->assertSame($expected, $this->fixture->filter($input)); }
/** * 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; }