/** * @testdox replace() creates a #regexp filter for each attribute created */ public function testCreatesAttributesWithFilter() { $tag = $this->configurator->Preg->replace('/(?<w>[0-9]+),(?<h>[0-9]+)/', ''); $regexp = '/^[0-9]+$/D'; $filter = new RegexpFilter($regexp); $callback = $filter->getCallback(); $this->assertSame($callback, $tag->attributes['w']->filterChain[0]->getCallback()); $this->assertSame($regexp, $tag->attributes['w']->filterChain[0]->getRegexp()); $this->assertSame($callback, $tag->attributes['h']->filterChain[0]->getCallback()); $this->assertSame($regexp, $tag->attributes['h']->filterChain[0]->getRegexp()); }
/** * @testdox Callback is s9e\TextFormatter\Parser\BuiltInFilters::filterRegexp() */ public function testCallback() { $filter = new RegexpFilter(); $this->assertSame('s9e\\TextFormatter\\Parser\\BuiltInFilters::filterRegexp', $filter->getCallback()); }