Example #1
0
 /**
  * @param Stub $stub
  * @param Mockster $mockster
  * @param History $history
  */
 public function __construct(Stub $stub, Mockster $mockster, History $history)
 {
     $this->history = $history;
     $this->stub = $stub;
     $this->mockster = $mockster;
     $args = $this->printArguments($this->stub->arguments());
     $this->methodCall = $this->stub->className() . '::' . $this->stub->methodName() . "({$args})";
 }
Example #2
0
 /**
  * @param Stub $stub
  * @return string
  */
 public function printStub(Stub $stub)
 {
     $class = $stub->className();
     $method = $stub->methodName();
     $calls = $stub->has()->calls();
     if (!$calls) {
         return "No calls recorded for [{$class}::{$method}()]";
     }
     return "History of [{$class}::{$method}()]\n  " . $this->printCalls($method, $calls);
 }