protected function setUp()
 {
     parent::setUp();
     $this->configEditor = $this->prophesize('ConsoleHelpers\\ConsoleKit\\Config\\ConfigEditor');
     $this->workingCopyResolver = $this->prophesize('ConsoleHelpers\\SVNBuddy\\Repository\\WorkingCopyResolver');
     $this->command = $this->prophesize('ConsoleHelpers\\SVNBuddy\\Command\\AbstractCommand');
     $this->command->willImplement('ConsoleHelpers\\SVNBuddy\\Command\\IConfigAwareCommand');
     $this->command->getName()->willReturn('sample-command');
     $this->commandConfig = new CommandConfig($this->configEditor->reveal(), $this->workingCopyResolver->reveal());
 }
Пример #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;
 }
Пример #3
0
 /**
  * @param string $interface
  */
 public function implement($interface)
 {
     $this->prophecy->willImplement($interface);
 }