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


PHP PresenterInterface::presentString方法代碼示例

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


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

示例1: negativeMatch

 /**
  * Evaluates negative match.
  *
  * @param string $name
  * @param mixed  $subject
  * @param array  $arguments
  *
  * @throws \PhpSpec\Exception\Example\FailureException
  * @return boolean
  */
 public function negativeMatch($name, $subject, array $arguments)
 {
     $checker = $this->getCheckerName($name);
     if (call_user_func($checker, $subject)) {
         throw new FailureException(sprintf('%s not expected to return %s, but it did.', $this->presenter->presentString(sprintf('%s(%s)', $checker, $this->presenter->presentValue($subject))), $this->presenter->presentValue(true)));
     }
 }
開發者ID:manhvu1212,項目名稱:videoplatform,代碼行數:17,代碼來源:ScalarMatcher.php

示例2: get

 /**
  * @param string $name
  *
  * @return Collaborator
  *
  * @throws \PhpSpec\Exception\Wrapper\CollaboratorException
  */
 public function get($name)
 {
     if (!$this->has($name)) {
         throw new CollaboratorException(sprintf('Collaborator %s not found.', $this->presenter->presentString($name)));
     }
     return $this->collaborators[$name];
 }
開發者ID:BuddhiEash,項目名稱:laravel_crm,代碼行數:14,代碼來源:CollaboratorManager.php

示例3: find

 /**
  * @param $keyword
  * @param $subject
  * @param  array                                               $arguments
  * @return mixed
  * @throws \PhpSpec\Exception\Wrapper\MatcherNotFoundException
  */
 public function find($keyword, $subject, array $arguments)
 {
     foreach ($this->matchers as $matcher) {
         if (true === $matcher->supports($keyword, $subject, $arguments)) {
             return $matcher;
         }
     }
     throw new MatcherNotFoundException(sprintf('No %s(%s) matcher found for %s.', $this->presenter->presentString($keyword), $this->presenter->presentValue($arguments), $this->presenter->presentValue($subject)), $keyword, $subject, $arguments);
 }
開發者ID:burimshala,項目名稱:numbertowords,代碼行數:16,代碼來源:MatcherManager.php

示例4: let

 function let(PresenterInterface $presenter)
 {
     $presenter->presentValue(Argument::any())->willReturn('val');
     $presenter->presentString(Argument::any())->willReturnArgument();
     $this->beConstructedWith('custom', function () {
     }, $presenter);
 }
開發者ID:manhvu1212,項目名稱:videoplatform,代碼行數:7,代碼來源:CallbackMatcherSpec.php

示例5:

 function it_creates_an_accessing_property_on_non_object_exception(PresenterInterface $presenter)
 {
     $presenter->presentString("{$this->fixture->property}")->shouldBeCalled()->willReturn("\"{$this->fixture->property}\"");
     $fixtureMessage = "Getting property \"{$this->fixture->property}\" on a non-object.";
     $exception = $this->gettingPropertyOnNonObject($this->fixture->property);
     $exception->shouldHaveType('PhpSpec\\Exception\\Wrapper\\SubjectException');
     $exception->getMessage()->shouldBe($fixtureMessage);
 }
開發者ID:qasem2rubik,項目名稱:laravel,代碼行數:8,代碼來源:ExceptionFactorySpec.php

示例6: let

 function let(PresenterInterface $presenter)
 {
     $presenter->presentValue(Argument::any())->will(function ($subject) {
         if (is_array($subject[0])) {
             return 'array';
         }
         if (is_object($subject[0])) {
             return 'object';
         }
         return $subject[0];
     });
     $presenter->presentString(Argument::any())->willReturnArgument();
     $this->beConstructedWith($presenter);
 }
開發者ID:focuslife,項目名稱:v0.1,代碼行數:14,代碼來源:ArrayKeyValueMatcherSpec.php

示例7: let

 function let(PresenterInterface $presenter)
 {
     $presenter->presentString(Argument::type('string'))->willReturnArgument();
     $this->beConstructedWith($presenter);
 }
開發者ID:burimshala,項目名稱:numbertowords,代碼行數:5,代碼來源:StringEndMatcherSpec.php

示例8: getNegativeFailureException

 /**
  * @param string $name
  * @param mixed  $subject
  * @param array  $arguments
  *
  * @return FailureException
  */
 protected function getNegativeFailureException($name, $subject, array $arguments)
 {
     return new FailureException(sprintf('Expected %s not to match %s regex, but it does.', $this->presenter->presentString($subject), $this->presenter->presentString($arguments[0])));
 }
開發者ID:EnmanuelCode,項目名稱:backend-laravel,代碼行數:11,代碼來源:StringRegexMatcher.php

示例9: let

 function let(PresenterInterface $presenter)
 {
     $presenter->presentValue(Argument::any())->willReturn('countable');
     $presenter->presentString(Argument::any())->willReturnArgument();
     $this->beConstructedWith($presenter);
 }
開發者ID:qasem2rubik,項目名稱:laravel,代碼行數:6,代碼來源:ArrayContainMatcherSpec.php

示例10: gettingPropertyOnNonObject

 /**
  * @param string $property
  *
  * @return SubjectException
  */
 public function gettingPropertyOnNonObject($property)
 {
     return new SubjectException(sprintf('Getting property %s on a non-object.', $this->presenter->presentString($property)));
 }
開發者ID:edwardricardo,項目名稱:zenska,代碼行數:9,代碼來源:ExceptionFactory.php

示例11: getNegativeFailureException

 /**
  * @param string $name
  * @param mixed  $subject
  * @param array  $arguments
  *
  * @return FailureException
  */
 protected function getNegativeFailureException($name, $subject, array $arguments)
 {
     return new FailureException(sprintf('%s not expected to %s(%s), but it did.', $this->presenter->presentValue($subject), $this->presenter->presentString($name), implode(', ', array_map(array($this->presenter, 'presentValue'), $arguments))));
 }
開發者ID:mawaha,項目名稱:tracker,代碼行數:11,代碼來源:CallbackMatcher.php

示例12: interfaceNotImplemented

 /**
  * @return InterfaceNotImplementedException
  */
 private function interfaceNotImplemented()
 {
     return new InterfaceNotImplementedException(sprintf('%s does not implement %s interface, but should.', $this->presenter->presentValue($this->caller->getWrappedObject()), $this->presenter->presentString('ArrayAccess')), $this->caller->getWrappedObject(), 'ArrayAccess');
 }
開發者ID:manhvu1212,項目名稱:videoplatform,代碼行數:7,代碼來源:SubjectWithArrayAccess.php

示例13: getNegativeFailureException

 /**
  * @param string $name
  * @param mixed  $subject
  * @param array  $arguments
  *
  * @return FailureException
  */
 protected function getNegativeFailureException($name, $subject, array $arguments)
 {
     return new FailureException(sprintf('Did not expect instance of %s, but got %s.', $this->presenter->presentString($arguments[0]), $this->presenter->presentValue($subject)));
 }
開發者ID:burimshala,項目名稱:numbertowords,代碼行數:11,代碼來源:TypeMatcher.php

示例14: getNegativeFailureException

 /**
  * @param string $name
  * @param mixed  $subject
  * @param array  $arguments
  *
  * @return FailureException
  */
 protected function getNegativeFailureException($name, $subject, array $arguments)
 {
     return new FailureException(sprintf('Expected %s not to have %s items, but got it.', $this->presenter->presentValue($subject), $this->presenter->presentString(intval($arguments[0]))));
 }
開發者ID:EnmanuelCode,項目名稱:backend-laravel,代碼行數:11,代碼來源:ArrayCountMatcher.php


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