Development

Changeset 20964

You must first sign up to be able to contribute.

Changeset 20964

Show
Ignore:
Timestamp:
08/09/09 17:25:49 (5 years ago)
Author:
bschussek
Message:

Fixed property transformation in LimeTesterObject?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/lime/branches/2.0-experimental/lib/tester/LimeTesterObject.php

    r20962 r20964  
    3030    foreach ((array)$object as $key => $value) 
    3131    { 
    32       // private and protected properties start with \0 
     32      // properties are transformed to keys in the following way: 
     33 
     34      // private   $property => "\0Classname\0property" 
     35      // protected $property => "\0*\0property" 
     36      // public    $property => "property" 
     37 
    3338      if ($key{0} == "\0") 
    3439      { 
    35         // private properties start with the class 
    36         if (strpos($key, get_class($object)) === 1) 
     40        if ($key{1} == '*') 
    3741        { 
    38           $key = substr($key, strlen(get_class($object))+2); 
     42          $key = substr($key, 3); 
    3943        } 
    40         // protected properties start with * 
    4144        else 
    4245        { 
    43           $key = substr($key, 3); 
     46          $key = substr($key, strlen(get_class($object)) + 2); 
    4447        } 
    4548      }