Inheritance: implements mockery\ExpectationInterface
Ejemplo n.º 1
0
 /**
  * WordPress testing function used to avoid return expectations on action hooks.
  * Throws exception for WordPress filters and generic PHP function testing.
  *
  * @param  callable             $callback
  * @return \Mockery\Expectation
  */
 public function whenHappen(callable $callback)
 {
     if (!$this->isAddedHook && !$this->isAction) {
         throw new RuntimeException('whenHappen() can only be used for WordPress actions or added filters expectations.');
     }
     return $this->expectation->andReturnUsing($callback);
 }
 /**
  * @return $this
  */
 public function between($minimum, $maximum)
 {
     $this->expectation->between($minimum, $maximum);
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * @expectedException \Link0\Phpebble\Api\ServiceUnavailable
  * @expectedExceptionMessage Service unavailable
  */
 public function test_service_unavailable()
 {
     $this->sendMethod->andReturnUsing($this->createClientException(503));
     $this->performPush();
 }
 /**
  */
 public function testGarbageCollection()
 {
     $this->dispose->with(false)->once();
     $this->captcha = null;
 }