Add extcmd.c compilation to test/php/runtests.sh

Add binary to .gitignore and fix test path generation of cache
dir.

refs #4258
This commit is contained in:
Marius Hein 2013-06-11 14:20:32 +02:00 committed by Eric Lippmann
parent a6100acaa8
commit 521baeba5e
2 changed files with 13 additions and 1 deletions

3
.gitignore vendored
View File

@ -9,3 +9,6 @@ test/js/npm-debug.log
# ./configure output # ./configure output
config.log config.log
# cmd tester
test/php/bin/extcmd_test

View File

@ -45,10 +45,18 @@ class ParserMock {
require("Zend/Cache.php"); require("Zend/Cache.php");
class ReaderTest extends \PHPUnit_Framework_TestCase class ReaderTest extends \PHPUnit_Framework_TestCase
{ {
protected function tearDown()
{
if (file_exists('./tmp')) {
@system("rm -rf ./tmp");
}
}
public function testFileCaching() { public function testFileCaching() {
if (!file_exists('./tmp')) {
mkdir('./tmp');
}
$parser = new ParserMock(); $parser = new ParserMock();
@system("rm /tmp/zend_cache*");
$parser->runtime = array("host"=>array( $parser->runtime = array("host"=>array(
"test" => (object) array( "test" => (object) array(
"host_name" => "test" "host_name" => "test"
@ -68,6 +76,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
system("rm /tmp/zend_cache*"); system("rm /tmp/zend_cache*");
} }
public function testEmptyFileException() { public function testEmptyFileException() {
$this->setExpectedException("Icinga\Exception\ConfigurationError"); $this->setExpectedException("Icinga\Exception\ConfigurationError");
$parser = new ParserMock(); $parser = new ParserMock();
$reader = new Reader(new ConfigMock(array( $reader = new Reader(new ConfigMock(array(