Development

Changeset 20700

You must first sign up to be able to contribute.

Changeset 20700

Show
Ignore:
Timestamp:
08/02/09 16:50:22 (5 years ago)
Author:
bschussek
Message:

Fixed: Assertions always fail if not implemented, otherwise the BadMethodCallExceptions? could confuse users

Files:

Legend:

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

    r20699 r20700  
    110110  } 
    111111 
    112   private function notImplemented($method) 
    113   { 
    114     throw new BadMethodCallException(sprintf('"%s" is not implemtented for type "%s"', $method, $this->type)); 
    115   } 
    116  
    117112  public function assertEquals(LimeTesterInterface $expected) 
    118113  { 
    119     $this->notImplemented('=='); 
     114    throw new LimeNotEqualException($this, $expected); 
    120115  } 
    121116 
    122117  public function assertNotEquals(LimeTesterInterface $expected) 
    123118  { 
    124     $this->notImplemented('!='); 
     119    throw new LimeNotEqualException($this, $expected); 
    125120  } 
    126121 
    127122  public function assertSame(LimeTesterInterface $expected) 
    128123  { 
    129     $this->notImplemented('==='); 
     124    throw new LimeNotEqualException($this, $expected); 
    130125  } 
    131126 
    132127  public function assertNotSame(LimeTesterInterface $expected) 
    133128  { 
    134     $this->notImplemented('!=='); 
     129    throw new LimeNotEqualException($this, $expected); 
    135130  } 
    136131 
    137132  public function assertLike(LimeTesterInterface $expected) 
    138133  { 
    139     $this->notImplemented('like'); 
     134    throw new LimeNotEqualException($this, $expected); 
    140135  } 
    141136 
    142137  public function assertUnlike(LimeTesterInterface $expected) 
    143138  { 
    144     $this->notImplemented('unlike'); 
     139    throw new LimeNotEqualException($this, $expected); 
    145140  } 
    146141 
    147142  public function assertGreaterThan(LimeTesterInterface $expected) 
    148143  { 
    149     $this->notImplemented('>'); 
     144    throw new LimeNotEqualException($this, $expected); 
    150145  } 
    151146 
    152147  public function assertGreaterThanOrEqual(LimeTesterInterface $expected) 
    153148  { 
    154     $this->notImplemented('>='); 
     149    throw new LimeNotEqualException($this, $expected); 
    155150  } 
    156151 
    157152  public function assertLessThan(LimeTesterInterface $expected) 
    158153  { 
    159     $this->notImplemented('<'); 
     154    throw new LimeNotEqualException($this, $expected); 
    160155  } 
    161156 
    162157  public function assertLessThanOrEqual(LimeTesterInterface $expected) 
    163158  { 
    164     $this->notImplemented('<='); 
     159    throw new LimeNotEqualException($this, $expected); 
    165160  } 
    166161 
    167162  public function assertContains(LimeTesterInterface $expected) 
    168163  { 
    169     $this->notImplemented('contains'); 
     164    throw new LimeNotEqualException($this, $expected); 
    170165  } 
    171166 
    172167  public function assertNotContains(LimeTesterInterface $expected) 
    173168  { 
    174     $this->notImplemented('contains not'); 
     169    throw new LimeNotEqualException($this, $expected); 
    175170  } 
    176171}