develooper Front page | perl.php.sandwich.dev | Postings from August 2005

Re: [svn:PHP-Sandwich] r1452 - PHP-Sandwich/trunk/t

Thread Previous
From:
=?ISO-8859-1?Q?Jo=E3o_Pedro_Gon=E7alves?=
Date:
August 3, 2005 09:45
Subject:
Re: [svn:PHP-Sandwich] r1452 - PHP-Sandwich/trunk/t
Message ID:
f426e8367a1159b283fb4de23bf34b6a@co.sapo.pt
Works great, thanks!

João Pedro Gonçalves
SAPO

On Aug 3, 2005, at 17:44, gschlossnagle@cvs.perl.org wrote:

> Author: gschlossnagle
> Date: Wed Aug  3 09:44:39 2005
> New Revision: 1452
>
> Modified:
>    PHP-Sandwich/trunk/t/16.t
> Log:
> Add test for write access segfault (joao gonclaves)
>
>
> Modified: PHP-Sandwich/trunk/t/16.t
> ======================================================================= 
> =======
> --- PHP-Sandwich/trunk/t/16.t	(original)
> +++ PHP-Sandwich/trunk/t/16.t	Wed Aug  3 09:44:39 2005
> @@ -1,6 +1,6 @@
>  #!/opt/ecelerity/3rdParty/bin/perl -w
>  use strict;
> -use Test::More tests => 6;
> +use Test::More tests => 9;
>
>  BEGIN {
>      diag "Testing passing blessed references into PHP";
> @@ -21,6 +21,12 @@ function property_access($obj, $prop)
>    return $obj->$prop;
>  }
>
> +function property_write($obj, $prop, $value)
> +{
> +  return $obj->$prop = $value;
> +}
> +
> +
>  function method_call($obj, $meth)
>  {
>    return $obj->$meth();
> @@ -41,6 +47,9 @@ $foo->{bar} = 'bar';
>  $foo->{baz} = 'baz';
>  is $p->get_class($foo), 'PerlSV::Foo', 'Checking class name';
>  is $p->property_access($foo, 'bar'), 'bar', 'Checking property  
> access';
> +ok $p->property_write($foo, 'bar', 'foo'), 'Checking property write  
> access';
> +is $p->property_access($foo, 'bar'), 'foo', 'Checking property  
> access';
> +ok $p->property_write($foo, 'bar', 'bar'), 'Checking property write  
> access';
>  is $p->method_call($foo, 'get'), 'bar', 'Checking method calls';
>  is_deeply $p->props_as_array($foo), {'bar' => 'bar', 'baz' => 'baz'},  
> 'Checking iterators';
>  package Foo;


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About