[svn:PHP-Sandwich] rev 1037 - PHP-Sandwich/trunk/t

[email protected] 2 May 2005 04:46:22 -0000
Newsgroups perl.php.sandwich.dev
Message-ID <[email protected]>
Author: shughes
Date: Sun May  1 21:46:22 2005
New Revision: 1037

Added:
   PHP-Sandwich/trunk/t/14.t   (contents, props changed)
Log:
add test for getVariable()


Added: PHP-Sandwich/trunk/t/14.t
==============================================================================
--- (empty file)
+++ PHP-Sandwich/trunk/t/14.t	Sun May  1 21:46:22 2005
@@ -0,0 +1,25 @@
+#!/opt/ecelerity/3rdParty/bin/perl
+use strict;
+use Test::More tests => 5;
+
+BEGIN {
+    use_ok 'PHP' or die;
+    use_ok 'PHP::Interpreter' or die;
+}
+
+our @var;
+
+push @var, "hello";
+push @var, "goodbye";
+
+diag "Testing basic function autoloadind";
+ok my $p = PHP::Interpreter->new, "Create new PHP interpreter";
+ok $p->eval(q/
+    function foo() {
+        $perl = Perl::getInstance();
+        $value = $perl->getVariable('@var');
+        return $value;
+    }
+/), 'Define PHP function that returns Perl values';
+my @phpval = $p->foo();
+ok $phpval[0] == 'hello', 'Check return value of PHP foo()';