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()); }
public function setUp() { $this->processHelper = $this->getMock('Gush\\Helper\\ProcessHelper'); $this->filesystemHelper = $this->prophesize('Gush\\Helper\\FilesystemHelper'); $this->filesystemHelper->getName()->willReturn('filesystem'); $this->gitConfigHelper = $this->prophesize('Gush\\Helper\\GitConfigHelper'); $this->gitConfigHelper->setHelperSet(Argument::any()); $this->gitConfigHelper->getName()->willReturn('git_config'); $this->realFsHelper = new FilesystemHelper(); $this->git = new GitHelper(new ProcessHelper(), $this->gitConfigHelper->reveal(), $this->realFsHelper); $this->unitGit = new GitHelper($this->processHelper, $this->gitConfigHelper->reveal(), $this->filesystemHelper->reveal()); }
/** * @test */ public function binds_and_renders() { $this->input->setOption('test-option', 'test-option'); $this->template->getName()->willReturn('test/foobar')->shouldBeCalled(); $this->template->bind(['author' => 'cslucano'])->shouldBeCalled(); $this->template->render()->willReturn('foo')->shouldBeCalled(); $this->helper->registerTemplate($this->template->reveal()); $res = $this->helper->bindAndRender(['author' => 'cslucano'], 'test', 'foobar'); $this->assertEquals('foo', $res); }
public static function configureSubject(ObjectProphecy $subject, array $options = array()) { $options = array_merge(array('iterations' => 1, 'name' => 'benchFoo', 'beforeMethods' => array(), 'afterMethods' => array(), 'parameterSets' => array(array(array())), 'groups' => array(), 'revs' => 1, 'notApplicable' => false, 'skip' => false, 'sleep' => 0, 'paramProviders' => array(), 'outputTimeUnit' => 'microseconds'), $options); $subject->getIterations()->willReturn($options['iterations']); $subject->getSleep()->willReturn($options['sleep']); $subject->getName()->willReturn($options['name']); $subject->getBeforeMethods()->willReturn($options['beforeMethods']); $subject->getAfterMethods()->willReturn($options['afterMethods']); $subject->getParameterSets()->willReturn($options['parameterSets']); $subject->getGroups()->willReturn($options['groups']); $subject->getRevs()->willReturn($options['revs']); $subject->getSkip()->willReturn($options['skip']); $subject->getParamProviders()->willReturn($options['paramProviders']); $subject->getOutputTimeUnit()->willReturn($options['outputTimeUnit']); }
protected function setUp() { $typeName = Cache::TYPE_NAME; $this->type = $this->prophesize('\\Elastica\\Type'); $this->type->request(Argument::any(), Argument::cetera())->willReturn(true); $this->type->getName()->willReturn($typeName); $this->index = $this->prophesize('\\Elastica\\Index'); $this->index->getType($typeName)->willReturn($this->type->reveal()); $this->index->exists()->willReturn(true); $nsDoc = new Document('DoctrineNamespaceCacheKey[]', [Cache::VALUE_FIELD => serialize($this->namespaceId)]); $this->type->getIndex()->willReturn($this->index->reveal()); $this->type->getDocument("DoctrineNamespaceCacheKey[]")->willReturn($nsDoc); $this->client = $this->prophesize('\\Elastica\\Client'); $this->client->getIndex($this->indexName)->willReturn($this->index->reveal()); $this->cache = new Cache($this->client->reveal(), ['index' => $this->indexName]); }
public function testNoSupports() { $this->requestMock->getName()->willReturn('foo')->shouldBeCalledTimes(1); $this->assertFalse($this->parser->supports($this->requestMock->reveal())); }