--- t/40-php.t 2008/06/03 10:22:49 147 +++ t/40-php.t 2008/06/03 10:23:52 148 @@ -8,12 +8,13 @@ =cut -use Jifty::Test tests => 8; +use Jifty::Test tests => 11; use Data::Dump qw/dump/; use_ok('A3C::PHP'); +$A3C::PHP::debug = 0; # mostly to prevent "used only once" warning $A3C::PHP::debug = 1 if @ARGV; ok( my $data = A3C::PHP->parse( << '__PHP_CONFIG__' @@ -23,12 +24,25 @@ $_baz = 'once'; $_baz = "twice"; + +$double_quoted = "this is \"quoted\" string"; +$single_quoted = 'and \'another\' one'; ?> __PHP_CONFIG__ ), 'parse'); diag dump( $data ); -is_deeply( $data, { _foo => 42, _bar => "is bar", _baz => "twice" }, 'correct' ); +is_deeply( $data, { + _foo => 42, + _bar => "is bar", + _baz => "twice", + double_quoted => 'this is "quoted" string', + single_quoted => "and 'another' one", +}, 'correct' ); + +ok( my $config = Jifty->config->app('strix'), 'strix config' ); +ok( my $dir = $config->{dir}, 'found strix dir' ); +ok( -e $dir, "$dir exists" ); sub php2data { my ( $php_path, $expected ) = @_; @@ -60,10 +74,10 @@ SKIP: { skip 'need function support', 1; - php2data( 'data/strix/etc/cms-qa/conf.php' ); + php2data( "$dir/etc/cms-qa/conf.php" ); } -php2data( 'data/strix/etc/new/conf.php', +php2data( "$dir/etc/new/conf.php", { _dbname => "new", _dbserver => "localhost",