/** * @testdox Only executes a normalization once per run if its "onlyOnce" property is true */ public function testOnlyOnce() { $templateNormalizer = new TemplateNormalizer(); $templateNormalizer->append(new DummyNormalization('?')); $templateNormalizer->append(new DummyNormalization('!'))->onlyOnce = true; $this->assertSame('Hi?!????', $templateNormalizer->normalizeTemplate('Hi')); }
/** * Constructor * * @return void */ public function __construct() { $this->normalizer = new TemplateNormalizer(); $this->normalizer->clear(); $this->normalizer->append('MergeConsecutiveCopyOf'); $this->normalizer->append('MergeIdenticalConditionalBranches'); $this->normalizer->append('OptimizeNestedConditionals'); }