You are here

public function Prophet::prophesize in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Prophet.php \Prophecy\Prophet::prophesize()

Creates new object prophecy.

Parameters

null|string $classOrInterface Class or interface name:

Return value

ObjectProphecy

File

vendor/phpspec/prophecy/src/Prophecy/Prophet.php, line 75

Class

Prophet
Prophet creates prophecies.

Namespace

Prophecy

Code

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;
}