Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make YAML an optional dependency.

  • Loading branch information...
commit 6a1a17019e4f65f7b8cb230de2fa59f5dd8f5dda 1 parent 3aa062a
Sebastian Bergmann authored
Showing with 18 additions and 13 deletions.
  1. +13 −8 PHPUnit/Util/Log/TAP.php
  2. +5 −5 package.xml
21 PHPUnit/Util/Log/TAP.php
View
@@ -47,7 +47,10 @@
require_once 'PHPUnit/Util/Filter.php';
require_once 'PHPUnit/Util/Printer.php';
require_once 'PHPUnit/Util/Test.php';
-require_once 'SymfonyComponents/YAML/sfYamlDumper.php';
+
+if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('SymfonyComponents/YAML/sfYamlDumper.php')) {
+ require_once 'SymfonyComponents/YAML/sfYamlDumper.php';
+}
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
@@ -137,14 +140,16 @@ public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_Asser
}
}
- $yaml = new sfYamlDumper();
+ if (class_exists('sfYamlDumper')) {
+ $yaml = new sfYamlDumper;
- $this->write(
- sprintf(
- " ---\n%s ...\n",
- $yaml->dump($diagnostic, 2, 2)
- )
- );
+ $this->write(
+ sprintf(
+ " ---\n%s ...\n",
+ $yaml->dump($diagnostic, 2, 2)
+ )
+ );
+ }
}
/**
10 package.xml
View
@@ -1102,11 +1102,6 @@
<pearinstaller>
<min>1.8.1</min>
</pearinstaller>
- <package>
- <name>YAML</name>
- <channel>pear.symfony-project.com</channel>
- <min>1.0.2</min>
- </package>
<extension>
<name>dom</name>
</extension>
@@ -1130,6 +1125,11 @@
<name>Log</name>
<channel>pear.php.net</channel>
</package>
+ <package>
+ <name>YAML</name>
+ <channel>pear.symfony-project.com</channel>
+ <min>1.0.2</min>
+ </package>
<extension>
<name>json</name>
</extension>
Please sign in to comment.
Something went wrong with that request. Please try again.