Development

Changeset 2868

You must first sign up to be able to contribute.

Changeset 2868

Show
Ignore:
Timestamp:
11/29/06 14:35:34 (2 years ago)
Author:
fabien
Message:

lime: fixed php 5.2 problems

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/lime/lib/lime.php

    r2805 r2868  
    8686  function is($exp1, $exp2, $message = '') 
    8787  { 
    88     if (!$result = $this->ok($exp1 == $exp2, $message)) 
     88    if (is_object($exp1) || is_object($exp2)) 
     89    { 
     90      $value = $exp1 === $exp2; 
     91    } 
     92    else 
     93    { 
     94      $value = $exp1 == $exp2; 
     95    } 
     96 
     97    if (!$result = $this->ok($value, $message)) 
    8998    { 
    9099      $this->output->diag(sprintf("           got: %s", str_replace("\n", '', var_export($exp1, true))), sprintf("      expected: %s", str_replace("\n", '', var_export($exp2, true)))); 
     
    507516    foreach (explode("\n", $lines) as $text) 
    508517    { 
    509       if (0 === strpos($text, 'not ok ')) 
     518      if (false !== strpos($text, 'not ok ')) 
    510519      { 
    511520        ++$this->current_test; 
     
    516525        ++$this->stats['_nb_tests']; 
    517526      } 
    518       else if (0 === strpos($text, 'ok ')) 
     527      else if (false !== strpos($text, 'ok ')) 
    519528      { 
    520529        ++$this->stats[$this->current_file]['nb_tests'];