createCollection() 공개 메소드

public createCollection ( Psr\Log\LoggerInterface $logger, string $buildFolder, string | null $file = null, array $fields = [], string $format = self::OUTPUT_FORMAT_PHP ) : WriterCollection
$logger Psr\Log\LoggerInterface
$buildFolder string
$file string | null
$fields array
$format string
리턴 Browscap\Writer\WriterCollection
 /**
  * runs before the build
  *
  * @param array       $fields
  * @param string|null $file
  * @param string      $format
  *
  * @return \Browscap\Generator\BuildCustomFileGenerator
  */
 protected function preBuild($fields = [], $file = null, $format = self::OUTPUT_FORMAT_PHP)
 {
     parent::preBuild();
     $this->getLogger()->info('started creating the custom output file');
     if (null === $this->collectionCreator) {
         $this->setCollectionCreator(new CollectionCreator());
     }
     if (null === $this->writerCollection) {
         $factory = new Writer\Factory\CustomWriterFactory();
         $this->setWriterCollection($factory->createCollection($this->getLogger(), $this->buildFolder, $file, $fields, $format));
     }
     return $this;
 }
예제 #2
0
 /**
  * tests creating a writer collection
  *
  * @group writer
  * @group sourcetest
  */
 public function testCreateCollection()
 {
     $logger = $this->createMock(\Monolog\Logger::class);
     $dir = vfsStream::url(self::STORAGE_DIR);
     self::assertInstanceOf(\Browscap\Writer\WriterCollection::class, $this->object->createCollection($logger, $dir));
 }
 /**
  * tests creating a writer collection
  *
  * @group writer
  * @group sourcetest
  */
 public function testCreateCollection()
 {
     $mockLogger = $this->getMock('\\Monolog\\Logger', array(), array(), '', false);
     $dir = vfsStream::url(self::STORAGE_DIR);
     self::assertInstanceOf('\\Browscap\\Writer\\WriterCollection', $this->object->createCollection($mockLogger, $dir));
 }