/** * as FileContainer can't exists without (in|out)put need to check that: * (in|out)put paths assigned successfully * (in|out)content is null * type should not be null and be detected using @see FileContainer::detectInputTypeByInputPath * * @param string $inputPath * @param string $outputPath * @param string $expectedType */ private function invokeConstructor($inputPath, $outputPath, $expectedType) { $file = new FileContainer($inputPath, $outputPath); $this->assertEquals($inputPath, $file->getInputPath()); $this->assertEquals($outputPath, $file->getOutputPath()); $this->assertNull($file->getOutputContent()); $this->assertNull($file->getInputContent()); $this->assertNotNull($file->getType()); $this->assertEquals($expectedType, $file->getType()); }
/** * @param FileContainer $file * * @return $this * @throws CompilerException */ protected function compileSCSS(FileContainer $file) { try { $this->scss->addImportPath(dirname($file->getInputPath())); $content = $this->scss->compile($file->getInputContent()); return $file->setOutputContent($content); } catch (ParserException $e) { throw new CompilerException($e->getMessage(), 1, $e); } }
/** * @see Processor::fetchInputContextIntoFile * @test */ public function fetchInputContextIntoFileOnSuccess() { $file = new FileContainer(static::getSharedFixturesDirectory() . '/scss/layout.scss', ''); $this->invokeMethod(new Processor($this->io), 'fetchInputContextIntoFile', [$file]); $this->assertNotNull($file->getInputContent()); }