Exemple #1
0
 /** Assets */
 public function testAssets()
 {
     $dir = __DIR__ . '/03';
     $outputDir = __DIR__ . '/03/output';
     $command = new Commands\Filesystem\Directory();
     $command->clean($outputDir);
     $res = glob($outputDir . "/*");
     $this->assertCount(0, $res);
     $command = new Commands\Filesystem\File();
     $command->copy($dir . '/package.json', $outputDir . '/package.json');
     $command->copy($dir . '/gulpfile.js', $outputDir . '/gulpfile.js');
     $command->copy($dir . '/test.less', $outputDir . '/test.less');
     ob_start();
     $command = new Commands\NodeJs\PackageInstaller();
     $command->setDirectory($outputDir);
     $command->setOptions(['silent' => TRUE]);
     $command->execute();
     ob_end_clean();
     ob_start();
     $command = new Commands\Assets\Gulp();
     $command->setGulpfile('gulpfile.js');
     $this->assertSame('gulpfile.js', $command->getGulpfile());
     $command->setDirectory($outputDir);
     $this->assertSame($outputDir, $command->getDirectory());
     $command->execute('test');
     $contents = ob_get_clean();
     $this->assertContains("Starting 'test'", $contents);
     $this->assertContains("Running test in Gulp.", $contents);
     ob_start();
     $command = new Commands\Assets\Less();
     $command->setExecutable('lessc');
     $this->assertSame('lessc', $command->getExecutable());
     $files = [$outputDir . '/test.less' => $outputDir . '/test.css'];
     $command->setFiles($files);
     $this->assertSame($files, $command->getFiles());
     $command->setOptions([]);
     $this->assertSame([], $command->getOptions());
     $command->execute();
     ob_end_clean();
     $this->assertFileExists($outputDir . '/test.css');
     $command = new Commands\Filesystem\Directory();
     $command->clean($outputDir);
 }
Exemple #2
0
 public function runInstallNpm()
 {
     $this->logSection('Install NPM');
     $this->nodeJsPackageInstaller->execute();
 }