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


PHP Factory::text方法代码示例

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


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

示例1: testDeleteResource

 public function testDeleteResource()
 {
     $expectedObject = ['dummyText' => $this->faker->text(), 'dummyNumber' => $this->faker->randomDigit()];
     $transport = $this->getMockBuilder('\\JsonApi\\Transports\\Guzzle')->setMethods(['delete'])->getMock();
     $transport->expects($this->once())->method('delete')->willReturn(json_encode($expectedObject));
     $client = new Client();
     $client->setTransport($transport);
     $client->deleteResource($this->faker->url());
 }
开发者ID:petitchevalroux,项目名称:php-jsonapi,代码行数:9,代码来源:ClientTest.php

示例2: testDependency

 public function testDependency()
 {
     $expectedDependency = $this->faker->text();
     $di = Di::getInstance();
     $dependencyDirectory = sys_get_temp_dir();
     $di->setDependenciesDirectory($dependencyDirectory);
     $tempname = tempnam($dependencyDirectory, '');
     $dependency = basename($tempname);
     $phpFile = $tempname . '.php';
     if (is_file($phpFile)) {
         unlink($phpFile);
     }
     file_put_contents($phpFile, "<?php\nreturn '" . addslashes($expectedDependency) . "';\n");
     $this->assertEquals($expectedDependency, $di->{$dependency});
     unlink($phpFile);
     unlink($tempname);
 }
开发者ID:petitchevalroux,项目名称:php-di,代码行数:17,代码来源:DiTest.php

示例3: testLoad

 public function testLoad()
 {
     $expectedVarValue = $this->faker->text();
     $configDirectory = sys_get_temp_dir();
     $loader = new Loader();
     $loader->setNamespace($configDirectory);
     $tempname = tempnam($configDirectory, '');
     $config = basename($tempname);
     $phpFile = $tempname . '.php';
     if (is_file($phpFile)) {
         unlink($phpFile);
     }
     file_put_contents($phpFile, "<?php\n\$dummy='" . addslashes($expectedVarValue) . "';\n");
     $this->assertEquals($expectedVarValue, $loader->loadByKey($loader->getConfigurationKey($config))->dummy);
     unlink($phpFile);
     unlink($tempname);
 }
开发者ID:petitchevalroux,项目名称:php-configuration-factory,代码行数:17,代码来源:PhpTest.php

示例4: makeNode

 /**
  * Generates a node
  * @param string $nodeId
  * @param string $startDate
  * @param string $endDate
  * @param string $oparg
  * @return string Node tag with random content
  */
 protected function makeNode($nodeId, $startDate, $endDate, $oparg = '')
 {
     $detail = $this->tag('detail', \htmlentities($this->faker->text(150)));
     $start = strtotime($startDate);
     $end = strtotime($endDate);
     //        $middleDate = date('Y-m-d H:i:s', $this->faker->numberBetween($start, $end));
     $attr = ['pk' => $nodeId, 'label' => 'Primary', 'start' => $startDate, 'end' => $endDate, 'layer' => $this->layers[0]['name'], 'oparg' => $oparg];
     $first = $this->tag('node', $detail, $attr);
     //        // use the second layer
     //        $attrTwo    = array_merge($attr, [
     //            'pk'    => "{$nodeId}-s",
     //            'label' => '&nbsp;', // We'll empty this
     //            'start' => $middleDate,
     //            'end'   => $endDate,
     //            'layer' => $this->layers[1]['name'],
     //        ]);
     //        $second     = $this->tag('node', $this->tag('detail', ''), $attrTwo);
     return "\n\t\t{$first}";
 }
开发者ID:ashon-ikon,项目名称:fake-xml-generator,代码行数:27,代码来源:xml-gen.php

示例5: testGetLoaderException

 public function testGetLoaderException()
 {
     $this->setExpectedException('\\ConfigurationFactory\\Exception', 'loader not setted');
     $factory = new ConfigurationFactory();
     $factory->get($this->faker->text());
 }
开发者ID:petitchevalroux,项目名称:php-configuration-factory,代码行数:6,代码来源:FactoryTest.php


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