當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。