當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Argument::containingString方法代碼示例

本文整理匯總了PHP中Prophecy\Argument::containingString方法的典型用法代碼示例。如果您正苦於以下問題:PHP Argument::containingString方法的具體用法?PHP Argument::containingString怎麽用?PHP Argument::containingString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Prophecy\Argument的用法示例。


在下文中一共展示了Argument::containingString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 function it_should_show_prompt(Application $application, OutputInterface $output, OutputFormatterInterface $outputFormatter)
 {
     $application->getName()->willReturn('some')->shouldBeCalled();
     $outputFormatter->format(Argument::containingString('some'))->shouldBeCalled()->willReturn('prompt');
     $output->write('prompt')->shouldBeCalled();
     $this->showPrompt();
 }
開發者ID:phpguard,項目名稱:phpguard,代碼行數:7,代碼來源:ShellSpec.php

示例2: testOnKernelRequestRelevantRequest

 public function testOnKernelRequestRelevantRequest()
 {
     $headerBag = $this->prophesize('Symfony\\Component\\HttpFoundation\\HeaderBag');
     $headerBag->get('Content-type', null)->willReturn('application/pgp-encrypted')->shouldBeCalled();
     $headerBag = $headerBag->reveal();
     $parameterBag = $this->prophesize('Symfony\\Component\\HttpFoundation\\ParameterBag');
     $parameterBag->set(Argument::containingString('decrypted'), Argument::type('string'))->shouldBeCalled();
     $parameterBag->set(Argument::containingString('signature'), Argument::any())->shouldBeCalled();
     $parameterBag = $parameterBag->reveal();
     $request = $this->prophesize('Symfony\\Component\\HttpFoundation\\Request');
     $request->getContent()->willReturn('foo')->shouldBeCalled();
     $request->headers = $headerBag;
     $request->request = $parameterBag;
     $request = $request->reveal();
     $args = $this->prophesize('Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent');
     $args->isMasterRequest()->willReturn(true);
     $args->getRequest()->willReturn($request);
     $args = $args->reveal();
     $decrypter = $this->prophesize();
     $decrypter->willImplement('Alameda\\Bundle\\EncryptionBundle\\Encryption\\DecrypterInterface');
     $decrypter->willImplement('Alameda\\Bundle\\EncryptionBundle\\Encryption\\AuthorizedSignatureInterface');
     $decrypter->decrypt(Argument::type('string'))->willReturn('foo');
     $decrypter->getSignature()->willReturn('bar');
     $decrypter = $decrypter->reveal();
     $subscriber = new DecryptSubscriber($decrypter);
     $subscriber->onKernelRequest($args);
 }
開發者ID:alameda-red,項目名稱:PrivacyGuardEncryptionBundle,代碼行數:27,代碼來源:DecryptSubscriberTest.php

示例3:

 public function test createKeyPair will notice the logger()
 {
     $dummyKeyPair = $this->prophesize(KeyPair::class)->reveal();
     $this->mockLogger->info(Argument::containingString('Generating new KeyPair'), Argument::any())->shouldBeCalled();
     $this->mockManager->generateKeyPair()->shouldBeCalled()->willReturn($dummyKeyPair);
     $this->mockStorage->store($dummyKeyPair)->shouldBeCalled();
     $this->service->createKeyPair();
 }
開發者ID:acmephp,項目名稱:symfony-bundle,代碼行數:8,代碼來源:KeyPairProviderTest.php

示例4: addLikeCriteriaSpec

 protected function addLikeCriteriaSpec(Collaborator $queryBuilder, Collaborator $expr, array $values, Collaborator $comparison)
 {
     $queryBuilder->expr()->shouldBeCalled()->willReturn($expr);
     $expr->like($this->getPropertyNameSpec(key($values)), Argument::containingString(':likeValue'))->shouldBeCalled()->willReturn($comparison);
     $queryBuilder->andWhere($comparison)->shouldBeCalled()->willReturn($queryBuilder);
     $queryBuilder->setParameter(Argument::containingString('likeValue'), '%' . $values[key($values)] . '%')->shouldBeCalled()->willReturn($queryBuilder);
     return $queryBuilder;
 }
開發者ID:dasklney,項目名稱:kreta,代碼行數:8,代碼來源:BaseEntityRepository.php

示例5: fputs

 function it_shows_message_when_pause_is_called(OutputInterface $output)
 {
     fputs($this->inputStream, "Y\n");
     rewind($this->inputStream);
     $this->activate();
     $this->pause('step name');
     $output->write(Argument::containingString('step name'))->shouldHaveBeenCalled();
 }
開發者ID:ciaranmcnulty,項目名稱:behat-stepthroughextension,代碼行數:8,代碼來源:CliPauserSpec.php

示例6: testThrowExceptionIfQueueDoesNotExist

 public function testThrowExceptionIfQueueDoesNotExist()
 {
     $input = $this->prophesize(InputInterface::class);
     $output = $this->prophesize(OutputInterface::class);
     $input->getOption('queue')->shouldBeCalled()->willReturn('default');
     $this->sqsClient->getQueueUrl(['QueueName' => 'default'])->shouldBeCalled()->willThrow(SqsException::class);
     $output->writeln(Argument::containingString('<error>Impossible to retrieve URL for queue "default"'))->shouldBeCalled();
     $this->executeCommand($input, $output);
 }
開發者ID:zf-fr,項目名稱:zfr-eb-worker,代碼行數:9,代碼來源:WorkerCommandTest.php

示例7: testLogError

 /**
  * It should log exceptions as ERROR.
  */
 public function testLogError()
 {
     $this->iterations->hasException()->willReturn(true);
     $this->iterations->getSubject()->willReturn($this->subject->reveal());
     $this->subject->getName()->willReturn('benchFoo');
     $this->output->write(Argument::containingString('ERROR'))->shouldBeCalled();
     $this->output->write(PHP_EOL)->shouldBeCalled();
     $this->logger->iterationsEnd($this->iterations->reveal());
 }
開發者ID:pborreli,項目名稱:phpbench,代碼行數:12,代碼來源:VerboseLoggerTest.php

示例8:

 function it_should_setup_container(Container $container, EventDispatcherInterface $dispatcher)
 {
     $container->setShared(Argument::any(), Argument::any())->shouldBeCalled();
     $container->set('phpguard', Argument::any())->shouldBeCalled();
     $container->get('dispatcher')->shouldBeCalled()->willReturn($dispatcher);
     $container->set('ui.application', $this)->shouldBeCalled();
     $container->setShared('ui.shell', Argument::any())->shouldBeCalled();
     $container->setShared(Argument::containingString('listeners'), Argument::any())->shouldBeCalled();
     $this->setupContainer($container);
 }
開發者ID:phpguard,項目名稱:phpguard,代碼行數:10,代碼來源:ApplicationSpec.php

示例9:

 public function test register will notice the logger()
 {
     $dummyKeyPair = $this->prophesize(KeyPair::class)->reveal();
     $mockClient = $this->prophesize(AcmeClient::class);
     $mockClient->registerAccount($this->dummyContactEmail)->shouldBeCalled();
     $mockLogger = $this->prophesize(LoggerInterface::class);
     $this->service->setLogger($mockLogger->reveal());
     $mockLogger->notice(Argument::containingString('Account {contactEmail} registered'), ['contactEmail' => $this->dummyContactEmail])->shouldBeCalled();
     $this->mockClientFactory->createAcmeClient($dummyKeyPair)->shouldBeCalled()->willReturn($mockClient->reveal());
     $this->service->register($dummyKeyPair);
 }
開發者ID:acmephp,項目名稱:symfony-bundle,代碼行數:11,代碼來源:AccountKeyPairProviderTest.php

示例10: testWrap

 /**
  * It should allow the PHP executable to be wrapped with a different executable.
  */
 public function testWrap()
 {
     $process = $this->prophesize('Symfony\\Component\\Process\\Process');
     $payload = new Payload(__DIR__ . '/template/foo.template', array(), $process->reveal());
     $payload->setWrapper('bockfire');
     $payload->setPhpPath('/boo/bar/php');
     $process->setCommandLine(Argument::containingString('bockfire /boo/bar/php'))->shouldBeCalled();
     $process->run()->shouldBeCalled();
     $process->isSuccessful()->willReturn(true);
     $process->getOutput()->willReturn('{"foo": "bar"}');
     $payload->launch($payload);
 }
開發者ID:stof,項目名稱:phpbench,代碼行數:15,代碼來源:PayloadTest.php

示例11: testUseSubjectTimeUnit

 /**
  * It should use the subject time unit.
  */
 public function testUseSubjectTimeUnit()
 {
     $this->iterations->getRejectCount()->willReturn(0);
     $this->iterations->getStats()->willReturn(array('mean' => 1.0, 'stdev' => 2.0, 'rstdev' => 20.0));
     $this->iterations->getSubject()->willReturn($this->subject->reveal());
     $this->iterations->getParameterSet()->willReturn($this->parameterSet->reveal());
     $this->subject->getOutputTimeUnit()->willReturn(TimeUnit::MICROSECONDS);
     $this->subject->getName()->willReturn('benchFoo');
     $this->parameterSet->getIndex()->willReturn(0);
     $this->output->writeln(Argument::containingString('1.000μs'))->shouldBeCalled();
     $this->logger->iterationsEnd($this->iterations->reveal());
 }
開發者ID:stof,項目名稱:phpbench,代碼行數:15,代碼來源:TravisLoggerTest.php

示例12: find_all_will_return_an_array_of_segments

 /**
  * @test
  */
 public function find_all_will_return_an_array_of_segments()
 {
     $client = $this->prophesize(Auth::class);
     $repository = new SegmentBillingRepository($client->reveal());
     $fakeResponse = $this->getFakeResponse($this->getMultipleBillingSegments());
     $client->request('GET', Argument::containingString('start_element=3'))->willReturn($fakeResponse)->shouldBeCalled();
     $segments = $repository->findAll('member_id', 3, 3);
     $this->assertNotEmpty($segments);
     foreach ($segments as $segment) {
         $this->assertInstanceOf(SegmentBilling::class, $segment);
     }
 }
開發者ID:audiens,項目名稱:appnexus-client,代碼行數:15,代碼來源:SegmentBillingRepositoryTest.php

示例13: preConsume_should_log_debug_message

 /**
  * @test
  */
 public function preConsume_should_log_debug_message()
 {
     $body = 'payload-body';
     $messageName = 'message-name';
     $methodName = 'MyClass::myMethod';
     /** @var ConsumerContainer $consumerContainer */
     $consumerContainer = $this->prophesize(ConsumerContainer::class);
     $consumerContainer->getRoutingKey()->willReturn($messageName);
     $consumerContainer->getMethodName()->willReturn($methodName);
     $event = new ConsumerEvent(new AMQPMessage($body), $consumerContainer->reveal());
     $this->subscriber->preConsume($event);
     $this->logger->debug(Argument::allOf(Argument::containingString($messageName), Argument::containingString($methodName), Argument::containingString($body)))->shouldHaveBeenCalled();
 }
開發者ID:rebuy-de,項目名稱:amqp-php-consumer,代碼行數:16,代碼來源:LogSubscriberTest.php

示例14: ProcessEvent

 function it_should_handle_runAllCommand_events(GenericEvent $event, ContainerInterface $container, PluginInterface $plugin, Logger $logger)
 {
     $event->getSubject()->willReturn($container);
     $event->addProcessEvent(Argument::any())->shouldBeCalled();
     $logger->addDebug(Argument::cetera())->shouldBeCalled();
     $logger->addDebug(Argument::containingString('Start'))->shouldBeCalled();
     $logger->addDebug(Argument::containingString('End'), Argument::cetera())->shouldBeCalled();
     $event->getArgument('plugin')->willReturn(null);
     $resultEvent = new ProcessEvent($plugin->getWrappedObject(), array());
     $plugin->getTitle()->willReturn('PluginSpec');
     $plugin->runAll()->shouldBeCalled()->willReturn($resultEvent);
     $this->runAllCommand($event);
 }
開發者ID:phpguard,項目名稱:phpguard,代碼行數:13,代碼來源:ChangesetListenerSpec.php

示例15: handle_should_log_message_with_payload

 /**
  * @test
  */
 public function handle_should_log_message_with_payload()
 {
     $exceptionMessage = "Fatal error";
     $baseException = new Exception($exceptionMessage);
     $payloadMessage = $this->prophesize(MessageInterface::class);
     $exception = new ConsumerContainerException($this->consumerContainer->reveal(), new AMQPMessage(), $payloadMessage->reveal(), $baseException);
     $this->handler->handle($exception);
     $this->logger->warning(Argument::allOf(Argument::containingString(self::MESSAGE_CLASS), Argument::containingString($exceptionMessage)), Argument::that(function ($context) use($baseException) {
         verify($context['exception'])->isInstanceOf(ConsumerContainerException::class);
         verify($context['exception']->getPrevious())->equals($baseException);
         return $context;
     }))->shouldHaveBeenCalled();
 }
開發者ID:rebuy-de,項目名稱:amqp-php-consumer,代碼行數:16,代碼來源:LoggerHandlerTest.php


注:本文中的Prophecy\Argument::containingString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。