/**
  * @issue ZF-7544
  */
 public function testAddFilterRuleMultipleTimes()
 {
     $rules = $this->inflector->getRules();
     $this->assertEquals(0, count($rules));
     $this->inflector->setFilterRule('controller', 'PregReplace');
     $rules = $this->inflector->getRules('controller');
     $this->assertEquals(1, count($rules));
     $this->inflector->addFilterRule('controller', array('Alpha', 'StringToLower'));
     $rules = $this->inflector->getRules('controller');
     $this->assertEquals(3, count($rules));
     $this->_context = 'StringToLower';
     $this->inflector->setStaticRuleReference('context', $this->_context);
     $this->inflector->addFilterRule('controller', array('Alpha', 'StringToLower'));
     $rules = $this->inflector->getRules('controller');
     $this->assertEquals(5, count($rules));
 }
Exemple #2
0
 /**
  * @issue ZF-7544
  */
 public function testAddFilterRuleMultipleTimes()
 {
     if (!extension_loaded('intl')) {
         $this->markTestSkipped('ext/intl not enabled');
     }
     $rules = $this->inflector->getRules();
     $this->assertEquals(0, count($rules));
     $this->inflector->setFilterRule('controller', 'PregReplace');
     $rules = $this->inflector->getRules('controller');
     $this->assertEquals(1, count($rules));
     $this->inflector->addFilterRule('controller', array('Alpha', 'StringToLower'));
     $rules = $this->inflector->getRules('controller');
     $this->assertEquals(3, count($rules));
     $this->_context = 'StringToLower';
     $this->inflector->setStaticRuleReference('context', $this->_context);
     $this->inflector->addFilterRule('controller', array('Alpha', 'StringToLower'));
     $rules = $this->inflector->getRules('controller');
     $this->assertEquals(5, count($rules));
 }