/** * @see FileContainer::detectInputTypeByInputPath * @test */ public function detectInputTypeByInputPath() { $inputPaths = ['input.css' => FileContainer::TYPE_UNKNOWN, 'input' => FileContainer::TYPE_UNKNOWN, 'input.sass' => FileContainer::TYPE_UNKNOWN, 'input.compass' => FileContainer::TYPE_UNKNOWN, 'input.scss' => FileContainer::TYPE_SCSS, 'input.less' => FileContainer::TYPE_LESS]; foreach ($inputPaths as $inputPath => $expectedType) { $file = new FileContainer($inputPath, ''); $this->assertEquals($expectedType, $file->getType()); } }
/** * @param FileContainer $file * * @throws FileException */ protected function fetchInputContextIntoFile(FileContainer $file) { if (!file_exists($file->getInputPath())) { throw new FileException("file: {$file->getInputPath()} doesn't exists"); } $file->setInputContent(file_get_contents($file->getInputPath())); }
/** * @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()); }