[svn:PHP-Sandwich] rev 1076 - in PHP-Sandwich/trunk: . t

[email protected] 8 Jun 2005 12:14:25 -0000
Newsgroups perl.php.sandwich.dev
Message-ID <[email protected]>
Author: gschlossnagle
Date: Wed Jun  8 05:14:25 2005
New Revision: 1076

Added:
   PHP-Sandwich/trunk/t/17.t   (contents, props changed)
Modified:
   PHP-Sandwich/trunk/PHP.xs
Log:
test resource passing


Modified: PHP-Sandwich/trunk/PHP.xs
==============================================================================
--- PHP-Sandwich/trunk/PHP.xs	(original)
+++ PHP-Sandwich/trunk/PHP.xs	Wed Jun  8 05:14:25 2005
@@ -950,6 +950,5 @@ void PHP_V_R_DESTROY(prsrc)
       tsrm_set_interpreter_context(old_ctx);
       /* potentially shutdown ZE */
       sandwich_interp_dec_ref(prsrc->interp);
-      fprintf(stderr, "freeing %p\n", prsrc);
       free(prsrc);
     }

Added: PHP-Sandwich/trunk/t/17.t
==============================================================================
--- (empty file)
+++ PHP-Sandwich/trunk/t/17.t	Wed Jun  8 05:14:25 2005
@@ -0,0 +1,19 @@
+#!/opt/ecelerity/3rdParty/bin/perl
+use strict;
+use Test::More tests => 7;
+
+BEGIN {
+    diag "Testing passing resources out of PHP";
+    use_ok 'PHP' or die;
+    use_ok 'PHP::Interpreter' or die;
+}
+
+ok my $p = PHP::Interpreter->new, "Create new PHP interpreter";
+ok my $fp = $p->fopen("/tmp/test", "a"), "Open a file with PHP";
+ok $p->fwrite($fp, "hello world"), "Write to the file";
+ok $p->fclose($fp), "Close the file";
+
+open FILE, "/tmp/test";
+my $content = <FILE>;
+is $content, "hello world", "File contents are correct";
+unlink "/tmp/test";