summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-28 16:05:57 +0100
committerRemi Collet <remi@remirepo.net>2017-11-28 16:05:57 +0100
commit4a5e8aba9e0a47e06d41530ce49a02a1b16361a6 (patch)
tree2706a6091b06e57eb061a03fcb37d0c19bc06d30
parent1ab207eebf4780984490d0aeb0ded203bd458731 (diff)
patches...
-rw-r--r--1348.patch45
-rw-r--r--php-Faker-bigendian.patch14
2 files changed, 59 insertions, 0 deletions
diff --git a/1348.patch b/1348.patch
new file mode 100644
index 0000000..635da1b
--- /dev/null
+++ b/1348.patch
@@ -0,0 +1,45 @@
+From cd1d5dd8a603eab9e02e331b61aa60e6cf6f8c78 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 10 Nov 2017 11:48:37 +0100
+Subject: [PATCH] only test available date range on 32-bit
+
+---
+ test/Faker/Provider/fi_FI/PersonTest.php | 19 +++++++++++++------
+ 1 file changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/test/Faker/Provider/fi_FI/PersonTest.php b/test/Faker/Provider/fi_FI/PersonTest.php
+index 5aefb8584..b979666e9 100644
+--- a/test/Faker/Provider/fi_FI/PersonTest.php
++++ b/test/Faker/Provider/fi_FI/PersonTest.php
+@@ -44,18 +44,25 @@ public function testPersonalIdentityNumberUsesBirthDateIfProvided($seed, $birthd
+
+ public function testPersonalIdentityNumberGeneratesCompliantNumbers()
+ {
+- for ($i = 0; $i < 10; $i++) {
+- $birthdate = $this->faker->dateTimeBetween('1800-01-01 00:00:00', '1899-12-31 23:59:59');
+- $pin = $this->faker->personalIdentityNumber($birthdate);
+- $this->assertRegExp('/^[0-9]{6}\+[0-9]{3}[0-9ABCDEFHJKLMNPRSTUVWXY]$/', $pin);
++ if (strtotime('1800-01-01 00:00:00')) {
++ $min="1900";
++ $max="2099";
++ for ($i = 0; $i < 10; $i++) {
++ $birthdate = $this->faker->dateTimeBetween('1800-01-01 00:00:00', '1899-12-31 23:59:59');
++ $pin = $this->faker->personalIdentityNumber($birthdate, NULL, true);
++ $this->assertRegExp('/^[0-9]{6}\+[0-9]{3}[0-9ABCDEFHJKLMNPRSTUVWXY]$/', $pin);
++ }
++ } else { // timestamp limit for 32-bit computer
++ $min="1902";
++ $max="2037";
+ }
+ for ($i = 0; $i < 10; $i++) {
+- $birthdate = $this->faker->dateTimeBetween('1900-01-01 00:00:00', '1999-12-31 23:59:59');
++ $birthdate = $this->faker->dateTimeBetween("$min-01-01 00:00:00", '1999-12-31 23:59:59');
+ $pin = $this->faker->personalIdentityNumber($birthdate);
+ $this->assertRegExp('/^[0-9]{6}-[0-9]{3}[0-9ABCDEFHJKLMNPRSTUVWXY]$/', $pin);
+ }
+ for ($i = 0; $i < 10; $i++) {
+- $birthdate = $this->faker->dateTimeBetween('2000-01-01 00:00:00', '2099-12-31 23:59:59');
++ $birthdate = $this->faker->dateTimeBetween('2000-01-01 00:00:00', "$max-12-31 23:59:59");
+ $pin = $this->faker->personalIdentityNumber($birthdate);
+ $this->assertRegExp('/^[0-9]{6}A[0-9]{3}[0-9ABCDEFHJKLMNPRSTUVWXY]$/', $pin);
+ }
diff --git a/php-Faker-bigendian.patch b/php-Faker-bigendian.patch
new file mode 100644
index 0000000..39eb713
--- /dev/null
+++ b/php-Faker-bigendian.patch
@@ -0,0 +1,14 @@
+diff --git a/test/Faker/Provider/UuidTest.php b/test/Faker/Provider/UuidTest.php
+index ebd4ae4..5c639ca 100644
+--- a/test/Faker/Provider/UuidTest.php
++++ b/test/Faker/Provider/UuidTest.php
+@@ -16,6 +16,9 @@ class UuidTest extends TestCase
+
+ public function testUuidExpectedSeed()
+ {
++ if (pack('L', 0x6162797A) == pack('N', 0x6162797A)) {
++ $this->markTestSkipped('Big Endian');
++ }
+ $faker = new Generator();
+ $faker->seed(123);
+ $this->assertEquals("8e2e0c84-50dd-367c-9e66-f3ab455c78d6", BaseProvider::uuid());