/** * @covers TextFile\Factory\ReaderFactory::createReader * * @expectedException \TextFile\Exception\InvalidReaderException */ public function testCreateReaderInvalidReader() { $readerFactory = new ReaderFactory(); $readerFactory->createReader(ReaderFactory::class, new SimpleWalker()); }
/** * @param int $characterNumber * @param string $readerClass * @param string $walkerClass * * @return string * @throws InvalidReaderException * @throws OutOfBoundsException */ public function getCharacterContent($characterNumber, $readerClass = SimpleReader::class, $walkerClass = SimpleWalker::class) { $walker = $this->walkerFactory->createWalker($walkerClass); return $this->readerFactory->createReader($readerClass, $walker)->getCharacterContent($this->splFileObject, $characterNumber); }