/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

require_once(dirname(__FILE__).'/../../bootstrap/unit.php');

sfConfig::set('sf_symfony_lib_dir', realpath(dirname(__FILE__).'/../../../lib'));

$t = new lime_test(5);

$handler = new sfGeneratorConfigHandler();
$handler->initialize();

$dir = dirname(__FILE__).DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'sfGeneratorConfigHandler'.DIRECTORY_SEPARATOR;

$t->diag('parse errors');
$files = array(
  $dir.'empty.yml',
  $dir.'no_generator_class.yml',
);

try
{
  $data = $handler->execute($files);
  $t->fail('generator.yml must have a "class" section');
}
catch (sfParseException $e)