/** * @test * @covers addTransformer */ public function testAddTransformer_clonesTransformerWhenApplyingAutomaticConstraints() { $transformer = $this->getMockTransformer(); $transformer->shouldReceive('addConstraint')->with(m::type('\\Optimus\\Constraint\\HasAttributeConstraint')); $this->dispatcher->addTransformer(array('#container', 'div.container'), $transformer); $wildcardListeners = $this->dispatcher->getListeners('*'); $divListeners = $this->dispatcher->getListeners('div'); $this->assertCount(1, $wildcardListeners); $this->assertCount(1, $divListeners); }