/** * @expectedException \RuntimeException */ public function testFailsWithoutAnyFactoryResponsible() { $factory = new Factory(); $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)); $factory->addFactory($factory1, 10); $factory->addFactory($factory2, 30); $path = $this->createPathMock(); $factory->findFactory($path, 'r+'); }
/** * Returns a default factory * * includes: * - CommitFactory * - LogFactory * - HeadFileFactory * - DefaultFactory * * @return Factory */ public static function getDefault() { $factory = parent::getDefault()->addFactory(new LogFactory(), 90); return $factory; }