zend-filter
zend-filter copied to clipboard
CamelCaseToDashFilter & numbers
Not sure if this is expected behavior but seems like a bug to me, but if you pass a string with numbers into CamelCaseToDashFilter
the dash is not applied before a number, please see below for a failing unit test.
public function testFilterSeparatesCamelCasedWordsContainingNumbersWithDashes()
{
$string = 'ItIs2016';
$filter = new CamelCaseToDashFilter();
$filtered = $filter($string);
$this->assertNotEquals($string, $filtered);
$this->assertEquals('It-Is-2016', $filtered);
}
This repository has been closed and moved to laminas/laminas-filter; a new issue has been opened at https://github.com/laminas/laminas-filter/issues/10.