当前位置: 首页>>代码示例>>PHP>>正文


PHP Generator::sentence方法代码示例

本文整理汇总了PHP中Generator::sentence方法的典型用法代码示例。如果您正苦于以下问题:PHP Generator::sentence方法的具体用法?PHP Generator::sentence怎么用?PHP Generator::sentence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Generator的用法示例。


在下文中一共展示了Generator::sentence方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test

 public function test()
 {
     for ($i = 0; $i < 10; $i++) {
         $sentence = $this->faker->sentence(30);
         $encrypted = $this->encrypter->encryptToString($sentence);
         $planString = $this->encrypter->decryptFromString($encrypted);
         $this->assertEquals($sentence, $planString);
     }
 }
开发者ID:powerlinks,项目名称:blowfish-encrypter,代码行数:9,代码来源:BlowfishEncrypterTest.php

示例2: testPersonTestValidationDescription

 public function testPersonTestValidationDescription()
 {
     $hostedPagesText = new HostedPagesText();
     $hostedPagesText->setPaymentMethodType(HostedPagesText::PAYMENT_METHOD_TYPE_CC)->setFee(500)->setDescription('')->setLocale(Codes::LOCALE_EN);
     $validation = new Validation();
     $validation->getValidator($hostedPagesText);
     $data = $validation->performValidation();
     $this->assertValidationReturned('Upg\\Library\\Request\\Objects\\HostedPagesText', 'description', 'Description is required', $data, "Description is required did not trigger");
     $hostedPagesText->setDescription($this->faker->sentence(90));
     $validation->getValidator($hostedPagesText);
     $data = $validation->performValidation();
     $this->assertValidationReturned('Upg\\Library\\Request\\Objects\\HostedPagesText', 'description', 'Description must be no more than 255 characters long', $data, "Description must be no more than 255 characters long did not trigger");
 }
开发者ID:vmrose,项目名称:clientlibrary,代码行数:13,代码来源:HostedPagesTextTest.php

示例3: testRefundValidationAmount

 public function testRefundValidationAmount()
 {
     $request = new Refund($this->config);
     $request->setOrderID(1)->setCaptureID(1)->setRefundDescription($this->faker->sentence(1));
     $validation = new Validation();
     $validation->getValidator($request);
     $data = $validation->performValidation();
     $this->assertValidationReturned('Upg\\Library\\Request\\Refund', 'amount', 'amount is required', $data, "amount is required failed to trigger");
 }
开发者ID:vmrose,项目名称:clientlibrary,代码行数:9,代码来源:RefundTest.php

示例4: testBasketItemValidationBasketItemText

 public function testBasketItemValidationBasketItemText()
 {
     $basketItem = new BasketItem();
     $basketItem->setBasketItemID('1')->setBasketItemCount(1)->setBasketItemAmount($this->getBasketItemAmount())->setBasketItemRiskClass(RiskClass::RISK_CLASS_DEFAULT);
     $validation = new Validation();
     $validation->getValidator($basketItem);
     $data = $validation->performValidation();
     /**
      * Test required validation
      */
     $this->assertValidationReturned('Upg\\Library\\Request\\Objects\\BasketItem', 'basketItemText', 'basketItemText is required', $data, "basketItemText is required did not trigger");
     $basketItem->setBasketItemText($this->faker->sentence(255));
     $validation->getValidator($basketItem);
     $data = $validation->performValidation();
     /**
      * Test the length validation
      */
     $this->assertValidationReturned('Upg\\Library\\Request\\Objects\\BasketItem', 'basketItemText', 'basketItemText must be no more than 500 characters', $data, "basketItemText must be no more than 500 characters did not trigger");
 }
开发者ID:vmrose,项目名称:clientlibrary,代码行数:19,代码来源:BasketItemTest.php

示例5: testExtendedInstantiation

 /**
  * Test if fixed values and extended options will be populated
  * in the appriate places;
  */
 public function testExtendedInstantiation()
 {
     $testMac = $this->faker->sentence(1);
     $testValue = $this->faker->name;
     $extendedVar = new \stdClass();
     $extendedVar->name = $this->faker->name;
     $extendedVar->userAgent = $this->faker->userAgent;
     $testArray = array('url' => $this->faker->url, 'tld' => $this->faker->tld);
     $successResponse = new SuccessResponse($this->config, array('mac' => $testMac, 'value' => $testValue, 'extendedVar' => $extendedVar, 'testArray' => $testArray));
     /**
      * Test method on config
      */
     $this->assertEquals($this->config, $successResponse->getData('config'));
     $this->assertEquals($this->config, $successResponse->getConfig());
     /**
      * Test method on mac
      */
     $this->assertEquals($testMac, $successResponse->getData('mac'));
     $this->assertEquals($testMac, $successResponse->getMac());
     /**
      * Test method on extended var
      */
     $this->assertEquals($extendedVar, $successResponse->getData('extendedVar'));
     $this->assertEquals($extendedVar, $successResponse->getExtendedVar());
     /**
      * ok now check if the that the extended data is in the responseData array
      * @see \Upg\Library\Response::responseData
      **/
     $extendedData = $successResponse->getAllData(true);
     $expectedExtendedData = array('value' => $testValue, 'extendedVar' => $extendedVar, 'testArray' => $testArray);
     $this->assertArrayHasKey('value', $extendedData);
     $this->assertArrayHasKey('extendedVar', $extendedData);
     $this->assertArrayHasKey('testArray', $extendedData);
     $this->assertArrayNotHasKey('mac', $extendedData);
     $this->assertArrayNotHasKey('config', $extendedData);
     $this->assertArraySubset($expectedExtendedData, $extendedData, true);
 }
开发者ID:vmrose,项目名称:clientlibrary,代码行数:41,代码来源:SuccessResponseTest.php


注:本文中的Generator::sentence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。