本文整理汇总了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());
}
}
}
示例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;
}
}
示例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)];
}
示例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];
}
示例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];
}