[svn:PHP-Sandwich] rev 998 - PHP-Sandwich/trunk/t
[email protected] 15 Apr 2005 21:33:31 -0000
| Newsgroups | perl.php.sandwich.dev |
|---|---|
| Message-ID | <[email protected]> |
Author: gschlossnagle
Date: Fri Apr 15 14:33:31 2005
New Revision: 998
Modified:
PHP-Sandwich/trunk/t/5.pl
Log:
convert to Test::More
Modified: PHP-Sandwich/trunk/t/5.pl
==============================================================================
--- PHP-Sandwich/trunk/t/5.pl (original)
+++ PHP-Sandwich/trunk/t/5.pl Fri Apr 15 14:33:31 2005
@@ -1,10 +1,23 @@
#!/opt/ecelerity/3rdParty/bin/perl
-use ExtUtils::testlib;
-use PHP;
-use PHP::Interpreter;
+use strict;
+use Test::More tests => 6;
+
+BEGIN {
+# use ExtUtils::testlib;
+ diag "Testing passing and return nested arrays.";
+ use_ok 'PHP' or die;
+ use_ok 'PHP::Interpreter' or die;
+}
+
+ok my $p = new PHP::Interpreter(), "Creating a new PHP::Interpreter.";
+ok $p->include('test.inc'), "including PHP testing functions.";
+my @list = ('I', 'AM', 'AN', ['NESTED', 'ARRAY']);
+ok my $arg = $p->ident(\@list), "Pass in a nested array and return it.";
+
+ok($arg->[0] eq 'I' &&
+ $arg->[1] eq 'AM' &&
+ $arg->[2] eq 'AN' &&
+ $arg->[3]->[0] eq 'NESTED' &&
+ $arg->[3]->[1] eq 'ARRAY',
+ "Testing that return array equals passed array.");
-$p = new PHP::Interpreter();
-$p->eval('function dump($a) { var_dump($a); }');
-@sublist = ( 'NESTED', 'ARRAY');
-@list = ('I', 'AM', 'AN', \@sublist);
-$arg = $p->dump(\@list);