Ejemplo n.º 1
0
 /**
  * @param string $classOrInterface
  */
 public function beADoubleOf($classOrInterface)
 {
     if (interface_exists($classOrInterface)) {
         $this->prophecy->willImplement($classOrInterface);
     } else {
         $this->prophecy->willExtend($classOrInterface);
     }
 }
Ejemplo n.º 2
0
 /**
  * Creates new object prophecy.
  *
  * @param null|string $classOrInterface Class or interface name
  *
  * @return ObjectProphecy
  */
 public function prophesize($classOrInterface = null)
 {
     $this->prophecies[] = $prophecy = new ObjectProphecy(new LazyDouble($this->doubler), new CallCenter($this->util), $this->revealer);
     if ($classOrInterface && class_exists($classOrInterface)) {
         return $prophecy->willExtend($classOrInterface);
     }
     if ($classOrInterface && interface_exists($classOrInterface)) {
         return $prophecy->willImplement($classOrInterface);
     }
     return $prophecy;
 }