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


PHP Generator::date方法代码示例

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


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

示例1: testResponse

 public function testResponse()
 {
     foreach (array(PaymentStatus::SUCCESS, PaymentStatus::DECLINED, PaymentStatus::INCOMPLETE) as $status) {
         $response = array('orderID' => $this->faker->randomNumber('####'), 'currency' => 'CHF', 'amount' => $this->faker->randomFloat(2, 1, 100), 'PM' => $this->faker->randomElement(array(PaymentMethod::POSTFINANCE_EFINANCE, PaymentMethod::CREDITCARD, PaymentMethod::POSTFINANCE_CARD)), 'ACCEPTANCE' => 'test123', 'STATUS' => $status, 'CARDNO' => 'XXXXXXXXXXXX' . $this->faker->randomNumber('####'), 'ED' => $this->faker->numberBetween(10, 12) . $this->faker->numberBetween(10, 99), 'CN' => $this->faker->name, 'TRXDATE' => $this->faker->date('m/d/Y'), 'PAYID' => $this->faker->randomNumber('########'), 'IPCTY' => $this->faker->countryCode, 'CCCTY' => $this->faker->countryCode, 'ECI' => '5', 'CVCCheck' => 'NO', 'AAVCheck' => 'NO', 'VC' => 'NO', 'IP' => $this->faker->ipv4, 'NCERROR' => '0');
         if ($response['PM'] === PaymentMethod::CREDITCARD) {
             $response['BRAND'] = $this->faker->randomElement(array(Brand::MASTERCARD, Brand::VISA));
         } elseif ($response['PM'] === PaymentMethod::POSTFINANCE_CARD) {
             $response['BRAND'] = PaymentMethod::POSTFINANCE_CARD;
         } elseif ($response['PM'] === PaymentMethod::POSTFINANCE_EFINANCE) {
             $response['BRAND'] = PaymentMethod::POSTFINANCE_EFINANCE;
         }
         $response['SHASIGN'] = $this->createHash($response, $this->environment->getShaOut(), $this->environment->getHashAlgorithm());
         $ePayment = new PostFinanceEPayment($this->environment);
         $response = $ePayment->getResponse($response);
         $this->assertTrue($response instanceof Response);
         if ($status === PaymentStatus::SUCCESS) {
             $this->assertFalse($response->hasError());
         } else {
             $this->assertTrue($response->hasError());
         }
     }
 }
开发者ID:whatwedo,项目名称:postfinance-e-payment,代码行数:22,代码来源:PostFinanceEPaymentTest.php

示例2: resolveConfigType

 private function resolveConfigType($config)
 {
     switch ($config['type']) {
         case "url":
             return $this->faker->url;
         case "image":
             $width = isset($config['options']['width']) ? $config['options']['width'] : 800;
             $height = isset($config['options']['height']) ? $config['options']['height'] : 400;
             return $this->faker->imageUrl($width, $height);
         case "page_select":
             $page = ['title' => $this->faker->sentence(), 'body' => $this->faker->text(6000), 'slug' => $this->faker->slug, 'created' => $this->faker->date()];
             return $page;
         case "product_category_select":
         case "collection_select":
             $category = ["name" => $this->faker->word, "slug" => $this->faker->slug];
             return $category;
         case "product_select":
             return $this->tdk->makeProduct();
         default:
             return $this->faker->word;
     }
 }
开发者ID:pasls,项目名称:tdk,代码行数:22,代码来源:ConfigManager.php

示例3: getDummyData

 public function getDummyData(Generator $faker)
 {
     return ['status' => $faker->randomElement(['open', 'delete', 'block', 'close']), 'ore_id' => $faker->numberBetween(0, 500), 'date_in' => $faker->date('Y-m-d', 'now'), 'type' => $faker->randomElement(['letter', 'suitcase', 'other']), 'sender_ref' => $faker->phoneNumber, 'sender_id' => rand(1, 10), 'sender_details' => $faker->company, 'issue' => $faker->paragraph(2), 'user_id' => $this->getRandom('User')->id, 'dependence_id' => rand(1, 16)];
 }
开发者ID:erichbriceno,项目名称:tacmail,代码行数:4,代码来源:MailTableSeeder.php

示例4: getDummyData

 public function getDummyData(Generator $faker, array $custom = [])
 {
     return ['number_document' => $faker->randomNumber($nbDigits = 5), 'description' => $faker->text, 'expiration' => $faker->date($format = 'Y-m-d', $max = 'now'), 'estatus' => $faker->randomElement($array = array('Received', 'Review', 'Correction', 'Signature', 'Sent')), 'responsable_id' => $this->random('User')->id, 'user_id' => $this->random('User')->id];
 }
开发者ID:aguila302,项目名称:oficios,代码行数:4,代码来源:DocumentTableSeeder.php

示例5: getDummyData

 public function getDummyData(Generator $faker, array $customValues = array())
 {
     return ['cliente_final' => $faker->name, 'tipo_servicio' => $faker->address, 'destino' => $faker->city, 'direccion_destino' => $faker->address, 'fecha_entrega' => $faker->date($format = 'd-m-Y', $max = 'now'), 'hora' => $faker->time($format = 'H:i:s', $max = 'now'), 'recepcionado_por' => $faker->name, 'dni' => $faker->address, 'cargo' => $faker->name, 'sello_firma' => $faker->address, 'responsable_entrega' => $faker->name, 'observaciones' => $faker->name, 'estado' => $faker->randomElement(['En almacen', 'En ruta', 'Entregado']), 'orden_servicio_id' => $this->getRandom('OrdenServicio')->id];
 }
开发者ID:jkrlos2791,项目名称:Courier,代码行数:4,代码来源:EntregaTableSeeder.php


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