/** * @covers TextFile\Factory\WriterFactory::createWriter * @expectedException \TextFile\Exception\InvalidWriterException */ public function testCreateWriterInvalidWriter() { $writerFactory = new WriterFactory(); $writerFactory->createWriter(WriterFactory::class); }
/** * @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); }