enforce() public static method

public static enforce ( $invariant, $msg )
Exemplo n.º 1
0
 public function getCalls($double, $method)
 {
     FBMock_Utils::assertString($method);
     $this->assertMethodExists($double, $method);
     if ($this->isStrictMock) {
         FBMock_Utils::enforce($this->getStub($method), "Trying to fetch calls for unmocked method %s on strict mock of %s", $method, $this->className);
     }
     if (isset($this->methodsToCalls[strtolower($method)])) {
         return $this->methodsToCalls[strtolower($method)];
     }
     return array();
 }
Exemplo n.º 2
0
 /**
  * @expectedException Exception
  * @expectedExceptionMessage Error message with 2 args
  */
 public function testEnforceFail()
 {
     FBMock_Utils::enforce(array(), 'Error message with %d %s', 2, 'args');
 }