/** * @param string $classOrInterface */ public function beADoubleOf($classOrInterface) { if (interface_exists($classOrInterface)) { $this->prophecy->willImplement($classOrInterface); } else { $this->prophecy->willExtend($classOrInterface); } }
/** * 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; }