Skip to content

Commit

Permalink
Make YAML an optional dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 19, 2010
1 parent 3aa062a commit 6a1a170
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
21 changes: 13 additions & 8 deletions PHPUnit/Util/Log/TAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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)
)
);
}
}

/**
Expand Down
10 changes: 5 additions & 5 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit 6a1a170

Please sign in to comment.