public function testRequestCompile()
 {
     $this->tracker->expects($this->once())->method('isOutdated')->willReturn(true);
     $this->compiler->expects($this->once())->method('compile');
     $this->dumper->expects($this->once())->method('dump');
     $this->event->expects($this->once())->method('isMasterRequest')->willReturn(true);
     (new RequestListener($this->tracker, $this->compiler, $this->dumper))->onRequest($this->event);
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->logger->info('[WEBPACK]: Compiling assets...');
     $this->compiler->compile();
     $this->logger->info('[WEBPACK]: Dumping assets...');
     $this->dumper->dump(new Filesystem());
     $this->logger->debug($this->profiler->get('compiler.last_output'));
 }
 /**
  * @param GetResponseEvent $event
  */
 public function onRequest(GetResponseEvent $event)
 {
     if (!$event->isMasterRequest()) {
         return;
     }
     if ($this->tracker->isOutdated()) {
         $this->compiler->compile();
     }
     $this->dumper->dump(new Filesystem());
 }
示例#4
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('Webpack [1/2]: Compiling Assets');
     $this->logger->info('[WEBPACK]: Compiling assets...');
     $this->compiler->compile();
     $output->writeln('Webpack [2/2]: Dumping Assets');
     $this->logger->info('[WEBPACK]: Dumping assets...');
     $this->dumper->dump();
     $message = $this->profiler->get('compiler.successful') ? sprintf('<info>Compilation done in %d ms.</info>', $this->profiler->get('compiler.performance.total')) : sprintf('<error>%s</error>', $this->profiler->get('compiler.last_output'));
     $output->writeln($message);
     $this->logger->debug($this->profiler->get('compiler.last_output'));
 }
示例#5
0
 /**
  * Rebuild the cache, check to see if it's still valid and rebuild if it's outdated.
  */
 public function rebuild()
 {
     if ($this->tracker->isOutdated()) {
         $this->logger->info('[Webpack 1/2]: Compiling assets.');
         $output = $this->compiler->compile();
         $this->logger->debug($output);
         $this->logger->info('[Webpack 2/2]: Dumping assets.');
         $this->dumper->dump();
     } else {
         $this->logger->info('[Webpack]: Cache still up-to-date.');
     }
 }
示例#6
0
 public function testDumpDefaults()
 {
     $this->dumper->dump();
 }
示例#7
0
 public function testDumpDefaults()
 {
     $this->dumper->dump($this->getMock(Filesystem::class));
 }