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

[email protected] 15 Apr 2005 22:11:24 -0000
Newsgroups perl.php.sandwich.dev
Message-ID <[email protected]>
Author: gschlossnagle
Date: Fri Apr 15 15:11:24 2005
New Revision: 1001

Added:
   PHP-Sandwich/trunk/t/6.t   (contents, props changed)
   PHP-Sandwich/trunk/t/7.t   (contents, props changed)
Log:
new tests


Added: PHP-Sandwich/trunk/t/6.t
==============================================================================
--- (empty file)
+++ PHP-Sandwich/trunk/t/6.t	Fri Apr 15 15:11:24 2005
@@ -0,0 +1,16 @@
+#!/opt/ecelerity/3rdParty/bin/perl 
+use strict;
+use Test::More tests => 4;
+
+BEGIN {
+    diag 'Check failed evals';
+    use_ok 'PHP' or die;
+    use_ok 'PHP::Interpreter' or die;
+}
+
+ok my $p = new PHP::Interpreter(), "Create new PHP interpreter";
+eval {
+  $p->eval('ini_set("display_errors", "Off");');
+  $p->eval('this isnt php');
+};
+like $@, qr/PHP Error in eval/, "eval error caught";

Added: PHP-Sandwich/trunk/t/7.t
==============================================================================
--- (empty file)
+++ PHP-Sandwich/trunk/t/7.t	Fri Apr 15 15:11:24 2005
@@ -0,0 +1,22 @@
+#!/opt/ecelerity/3rdParty/bin/perl 
+use strict;
+use Test::More tests => 8;
+
+BEGIN {
+    diag '3 ways of calling methods.';
+    use_ok 'PHP' or die;
+    use_ok 'PHP::Interpreter' or die;
+}
+
+ok my $p = new PHP::Interpreter(), "Create new PHP interpreter";
+ok my $a1 = $p->include('test.inc')->call('ident', 1), 
+  "Including a PHP file and executing a function off iti via call";
+
+ok my $p2 = new PHP::Interpreter(), "Create new PHP interpreter";
+ok my $a1 = $p2->include('test.inc')->ident(1), 
+  "Including a PHP file and executing a function off iti via AUTOLOAD";
+
+ok my $p3 = new PHP::Interpreter(), "Create new PHP interpreter";
+ok $p3->include('test.inc'), "Including a file";
+ok $p3->ident(1), 
+  "... and executing a function off it via AUTOLOAD (2)";