zend-filter icon indicating copy to clipboard operation
zend-filter copied to clipboard

CamelCaseToDashFilter & numbers

Open joshhornby opened this issue 8 years ago • 1 comments

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);
    }

joshhornby avatar Jun 29 '16 11:06 joshhornby

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.

weierophinney avatar Dec 31 '19 22:12 weierophinney