Exemplo n.º 1
0
 /**
  * @expectedException \RuntimeException
  */
 public function testFailsWithoutAnyFactoryResponsible()
 {
     $resolver = new Resolver();
     $factory1 = $this->createFactoryMock();
     $factory1->expects($this->any())->method('canHandle')->will($this->returnValue(false));
     $factory2 = $this->createFactoryMock();
     $factory2->expects($this->any())->method('canHandle')->will($this->returnValue(false));
     $resolver->addFactory($factory1, 10);
     $resolver->addFactory($factory2, 30);
     $path = $this->createPathMock();
     $resolver->findFactory($path, 'r+');
 }
Exemplo n.º 2
0
 /**
  * Creates the factory resolver
  *
  * @return  Resolver
  */
 protected function createBufferFactoryResolver()
 {
     $resolver = new Resolver();
     $resolver->addFactory(new CommitFactory(), 100)->addFactory(new LogFactory(), 90)->addFactory(new HeadFileFactory(), 80)->addFactory(new DefaultFactory(), -100);
     return $resolver;
 }