Пример #1
0
 /**
  * @expectedException \RuntimeException
  * @expectedExceptionMessage No detector is configured for this namer.
  */
 public function testNoDetector()
 {
     $name = 'Namer';
     $strategy = $this->getMockStrategy();
     $strategy->expects($this->never())->method('getName');
     $namer = new Namer($strategy);
     $namer->getName($name);
     // Will throw an exception with no detector configured.
 }
Пример #2
0
 /**
  * @param Namer $namer
  */
 public function addNamer(Namer $namer)
 {
     $this->namers[$namer->getName()] = $namer;
 }