readDirRecursively( $basePath, $this->files, 'in' );
parent::__construct();
}
public static function suite()
{
return new ezcFeedRegressionSuite( __CLASS__ );
}
protected function cleanForCompare( $text )
{
$text = preg_replace( '@.*?@', 'XXX', $text );
$text = preg_replace( '@.*?@', 'XXX', $text );
$text = preg_replace( '@.*?@', 'XXX', $text );
$text = preg_replace( '@.*?@', 'XXX', $text );
return $text;
}
public function testRunRegression( $file )
{
$errors = array();
$outFile = $this->outFileName( $file, '.in', '.out' );
$expected = trim( file_get_contents( $outFile ) );
$data = include_once( $file );
$feed = $this->createFeed( 'rss2', $data );
try
{
$generated = $feed->generate();
$generated = trim( $this->cleanForCompare( $generated ) );
$expected = $this->cleanForCompare( $expected );
}
catch ( ezcFeedException $e )
{
$generated = $e->getMessage();
}
$this->assertEquals( $expected, $generated, "The " . basename( $outFile ) . " is not the same as the generated feed from " . basename( $file ) . "." );
}
}
?>