/** * Returns the content of a given fixture file. * * @param $file * @return string */ function loadFixtureContent($file) { return normalize_line_endings(file_get_contents(getFixturePath($file))); }
public function testNormalizeLineEndingsRemovesCarriageReturns() { $this->assertEquals("\n", normalize_line_endings("\r\n")); $this->assertEquals("\n", normalize_line_endings("\r")); }
/** * Get contents of a given file. * * @param $file * * @return string */ public function getContents($file) { return normalize_line_endings(file_get_contents($this->getPath($file))); }
/** * Converts a PHP value to YAML. * * @param mixed $input The PHP value * @param int $inline The level where you switch to inline YAML * @param int $indent The level of indentation (used internally) * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or * object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * * @return string The YAML representation of the PHP value */ public function toYaml($input, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false) { return normalize_line_endings(Yaml::dump($input, $inline, $indent, $exceptionOnInvalidType, $objectSupport)); }