[svn:PHP-Sandwich] rev 1407 - PHP-Sandwich/trunk/t
[email protected] 19 Jul 2005 18:16:46 -0000
| Newsgroups | perl.php.sandwich.dev |
|---|---|
| Message-ID | <[email protected]> |
Author: theory
Date: Tue Jul 19 11:16:45 2005
New Revision: 1407
Modified:
PHP-Sandwich/trunk/t/1.t
PHP-Sandwich/trunk/t/19.t
PHP-Sandwich/trunk/t/2.t
Log:
Minor fixes, added missing test labels, fixed some warnings.
Modified: PHP-Sandwich/trunk/t/1.t
==============================================================================
--- PHP-Sandwich/trunk/t/1.t (original)
+++ PHP-Sandwich/trunk/t/1.t Tue Jul 19 11:16:45 2005
@@ -1,6 +1,6 @@
-#!/opt/ecelerity/3rdParty/bin/perl
+#!/opt/ecelerity/3rdParty/bin/perl
use strict;
-use Test::More tests => 5;
+use Test::More tests => 6;
BEGIN {
use_ok 'PHP' or die;
@@ -9,6 +9,6 @@ BEGIN {
# weird hack for include path
chdir('t');
ok my $p = new PHP::Interpreter(), "Create new PHP interpreter";
-ok $p->include('test.inc');
-my $a1 = $p->call('ident', 1), "Including a PHP file and executing a function off it";
+ok $p->include('test.inc'), 'Add test.inc';
+ok my $a1 = $p->call('ident', 1), "Including a PHP file and executing a function off it";
is $a1, 1, 'We should get the proper value from the ident() function';
Modified: PHP-Sandwich/trunk/t/19.t
==============================================================================
--- PHP-Sandwich/trunk/t/19.t (original)
+++ PHP-Sandwich/trunk/t/19.t Tue Jul 19 11:16:45 2005
@@ -10,13 +10,10 @@ BEGIN {
my $output;
my $data;
-ok my $p = PHP::Interpreter->new(
- {
- 'BRIC' =>
- {'special' => 'data',},
+ok my $p = PHP::Interpreter->new({
+ 'BRIC' => { 'special' => 'data', },
'OUTPUT' => \$output
- }),
- "Create new PHP interpreter";
+}), "Create new PHP interpreter";
$p->eval(q/print $BRIC['special'];/);
is $output, 'data', 'check output buffering (scalar pass by ref)';
$p->eval(q/print $BRIC['special'];/);
@@ -40,7 +37,7 @@ is $output, 'data', 'check output buffer
my $output2;
-sub pr { $output2 .= @_[0]; }
+sub pr { $output2 .= $_[0]; }
ok $p = PHP::Interpreter->new(
{
'BRIC' =>
Modified: PHP-Sandwich/trunk/t/2.t
==============================================================================
--- PHP-Sandwich/trunk/t/2.t (original)
+++ PHP-Sandwich/trunk/t/2.t Tue Jul 19 11:16:45 2005
@@ -14,4 +14,5 @@ ok $p->eval('function hello($a) { return
is $p->hello('george'), 'hello george',
'We should get the proper return value of the "hello" function"';
-is $p->eval('return "hello world";'), "hello world";
+is $p->eval('return "hello world";'), "hello world",
+ "A simple eval should return the return value";