Development

Changeset 20957

You must first sign up to be able to contribute.

Changeset 20957

Show
Ignore:
Timestamp:
08/09/09 14:43:32 (5 years ago)
Author:
bschussek
Message:

Modified implementation of LimeMockInvocation::equals() to use LimeTesters? for parameter comparison

Files:

Legend:

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

    r20955 r20957  
    5757    $equal = $this->method == $invocation->method && $this->class == $invocation->class; 
    5858 
     59    $exp1 = LimeTester::create($this->parameters); 
     60    $exp2 = LimeTester::create($invocation->parameters); 
     61 
    5962    if ($this->parameters == self::ANY_PARAMETERS) 
    6063    { 
    6164      return $equal; 
    6265    } 
    63     else if ($strict) 
     66 
     67    try 
    6468    { 
    65       return $equal && $this->parameters === $invocation->parameters; 
     69      if ($strict) 
     70      { 
     71        $exp1->assertSame($exp2); 
     72      } 
     73      else 
     74      { 
     75        $exp1->assertEquals($exp2); 
     76      } 
     77 
     78      return $equal; 
    6679    } 
    67     else 
     80    catch (LimeTesterException $e) 
    6881    { 
    69       return $equal && $this->parameters == $invocation->parameters
     82      return false
    7083    } 
    7184  }