/**
  * @covers TextFile\Factory\WalkerFactory::createWalker
  * @expectedException \TextFile\Exception\InvalidWalkerException
  */
 public function testCreateWalkerInvalidWalker()
 {
     $walkerFactory = new WalkerFactory();
     $walkerFactory->createWalker(WalkerFactory::class);
 }
Beispiel #2
0
 /**
  * @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);
 }