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

[email protected] 14 Apr 2005 21:09:53 -0000
Newsgroups perl.php.sandwich.dev
Message-ID <[email protected]>
Author: theory
Date: Thu Apr 14 14:09:53 2005
New Revision: 986

Modified:
   PHP-Sandwich/trunk/t/2.t
Log:
Please use Test::More for all tests. I've converted this test script to
Test::More as an example (untested--I'll need to install all the PHP stuff to
do so in the future).


Modified: PHP-Sandwich/trunk/t/2.t
==============================================================================
--- PHP-Sandwich/trunk/t/2.t	(original)
+++ PHP-Sandwich/trunk/t/2.t	Thu Apr 14 14:09:53 2005
@@ -1,15 +1,15 @@
-#!/opt/ecelerity/3rdParty/bin/perl 
+#!/opt/ecelerity/3rdParty/bin/perl
 use strict;
-use Test;
+use Test::More tests => 5;
 
-BEGIN { plan tests => 1 }
+BEGIN {
+    use_ok 'PHP' or die;
+    use_ok 'PHP::Interpreter' or die;
+}
 
-use PHP;
-use PHP::Interpreter;
-
-print "# Testing basic function autoloadind\n";
-my $p = new PHP::Interpreter();
-$p->eval('function hello($a) { return "hello $a"; }');
-my $arg = $p->hello('george');
-
-ok($arg eq 'hello george');
+diag "Testing basic function autoloadind";
+ok my $p = PHP::Interpreter->new, "Create new PHP interpreter";
+ok $p->eval('function hello($a) { return "hello $a"; }'),
+  'Add a "hello" function';
+is $p->hello('george'),  'hello george',
+  'We should get the proper return value of the "hello" function"';