예제 #1
0
 /**
  * @covers TextFile\Factory\WriterFactory::createWriter
  * @expectedException \TextFile\Exception\InvalidWriterException
  */
 public function testCreateWriterInvalidWriter()
 {
     $writerFactory = new WriterFactory();
     $writerFactory->createWriter(WriterFactory::class);
 }
예제 #2
0
 /**
  * @param string $content
  * @param bool   $newLine
  * @param string $writerClass
  *
  * @throws InvalidWriterException
  */
 public function writeToLine($content, $newLine = false, $writerClass = PrependingWriter::class)
 {
     $this->writerFactory->createWriter($writerClass)->write($this->splFileObject, $content, $newLine);
 }