From 7d999305ce794d67557192574a53d286627bc357 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 27 Mar 2019 13:03:44 +0100 Subject: open https://github.com/doctrine/migrations/pull/802 32-bit tests --- php-doctrine-migrations-rpm.patch | 40 +++++++++++++++++++++++++++++++++++++ php-doctrine-migrations-tests.patch | 25 +++++++++++++++++++++++ php-doctrine-migrations.spec | 7 +++++-- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 php-doctrine-migrations-rpm.patch create mode 100644 php-doctrine-migrations-tests.patch diff --git a/php-doctrine-migrations-rpm.patch b/php-doctrine-migrations-rpm.patch new file mode 100644 index 0000000..69be9f8 --- /dev/null +++ b/php-doctrine-migrations-rpm.patch @@ -0,0 +1,40 @@ +diff -up ./lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php.rpm ./lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php +--- ./lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php.rpm 2019-03-27 09:58:41.000000000 +0100 ++++ ./lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php 2019-03-27 10:19:22.365477263 +0100 +@@ -15,7 +15,6 @@ use Doctrine\Migrations\Tools\Console\Co + use Doctrine\Migrations\Tools\Console\Command\StatusCommand; + use Doctrine\Migrations\Tools\Console\Command\UpToDateCommand; + use Doctrine\Migrations\Tools\Console\Command\VersionCommand; +-use PackageVersions\Versions; + use Symfony\Component\Console\Application; + use Symfony\Component\Console\Helper\HelperSet; + +@@ -38,7 +37,7 @@ class ConsoleRunner + /** @param AbstractCommand[] $commands */ + public static function createApplication(HelperSet $helperSet, array $commands = []) : Application + { +- $cli = new Application('Doctrine Migrations', Versions::getVersion('doctrine/migrations')); ++ $cli = new Application('Doctrine Migrations', '2.0.0'); + $cli->setCatchExceptions(true); + $cli->setHelperSet($helperSet); + self::addCommands($cli); +diff -up ./tests/Doctrine/Migrations/Tests/Functional/CliTest.php.rpm ./tests/Doctrine/Migrations/Tests/Functional/CliTest.php +--- ./tests/Doctrine/Migrations/Tests/Functional/CliTest.php.rpm 2019-03-27 10:20:22.799818585 +0100 ++++ ./tests/Doctrine/Migrations/Tests/Functional/CliTest.php 2019-03-27 10:20:48.070961326 +0100 +@@ -17,7 +17,6 @@ use Doctrine\Migrations\Tools\Console\Co + use Doctrine\ORM\EntityManager; + use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; + use Doctrine\ORM\Tools\Setup as OrmSetup; +-use PackageVersions\Versions; + use ReflectionClass; + use RuntimeException; + use Symfony\Component\Console\Application; +@@ -227,7 +226,7 @@ class CliTest extends MigrationTestCase + ); + + $this->conn = $this->getSqliteConnection(); +- $this->application = new Application('Doctrine Migrations Test', Versions::getVersion('doctrine/migrations')); ++ $this->application = new Application('Doctrine Migrations Test', '@VERSION@'); + $this->application->setCatchExceptions(false); + $this->application->setAutoExit(false); + $this->application->getHelperSet()->set( diff --git a/php-doctrine-migrations-tests.patch b/php-doctrine-migrations-tests.patch new file mode 100644 index 0000000..ffee870 --- /dev/null +++ b/php-doctrine-migrations-tests.patch @@ -0,0 +1,25 @@ +From 7c92da024352261c0c5a9cfef59b9785eb5bd2d2 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 27 Mar 2019 12:53:04 +0100 +Subject: [PATCH] don't run with 64-bit data on 32-bit build + +--- + .../Doctrine/Migrations/Tests/Tools/BytesFormatterTest.php | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tests/Doctrine/Migrations/Tests/Tools/BytesFormatterTest.php b/tests/Doctrine/Migrations/Tests/Tools/BytesFormatterTest.php +index 5f5f24e29..f8acd4146 100644 +--- a/tests/Doctrine/Migrations/Tests/Tools/BytesFormatterTest.php ++++ b/tests/Doctrine/Migrations/Tests/Tools/BytesFormatterTest.php +@@ -14,7 +14,9 @@ public function testFormatBytes() : void + self::assertSame('1000', BytesFormatter::formatBytes(1000)); + self::assertSame('97.66K', BytesFormatter::formatBytes(100000)); + self::assertSame('9.54M', BytesFormatter::formatBytes(10000000)); +- self::assertSame('93.13G', BytesFormatter::formatBytes(100000000000)); +- self::assertSame('90.95T', BytesFormatter::formatBytes(100000000000000)); ++ if (PHP_INT_SIZE > 4) { ++ self::assertSame('93.13G', BytesFormatter::formatBytes(100000000000)); ++ self::assertSame('90.95T', BytesFormatter::formatBytes(100000000000000)); ++ } + } + } diff --git a/php-doctrine-migrations.spec b/php-doctrine-migrations.spec index fe12557..380868f 100644 --- a/php-doctrine-migrations.spec +++ b/php-doctrine-migrations.spec @@ -36,6 +36,7 @@ Source1: makesrc.sh # get rid of ocramius/package-versions Patch0: %{name}-rpm.patch +Patch1: %{name}-tests.patch BuildArch: noarch BuildRequires: php-fedora-autoloader-devel @@ -76,7 +77,7 @@ BuildRequires: (php-composer(symfony/process) >= 3.4 with php-composer( BuildRequires: (php-composer(symfony/yaml) >= 3.4 with php-composer(symfony/yaml) < 5) BuildRequires: (php-composer(jdorn/sql-formatter) >= 1.1 with php-composer(jdorn/sql-formatter) < 2) BuildRequires: (php-composer(mikey179/vfsStream) >= 1.6 with php-composer(mikey179/vfsStream) < 2) -# remirepo:14 +# remirepo:15 %else BuildRequires: php-composer(doctrine/orm) < 3 BuildRequires: php-composer(doctrine/orm) >= 2.6 @@ -116,7 +117,7 @@ Requires: (php-composer(symfony/stopwatch) >= 3.4 with php-composer( Requires: (php-composer(ocramius/proxy-manager) >= 2.0.2 with php-composer(ocramius/proxy-manager) < 3) Recommends: (php-composer(mikey179/vfsStream) >= 1.6 with php-composer(mikey179/vfsStream) < 2) Recommends: (php-composer(symfony/yaml) >= 3.3 with php-composer(symfony/yaml) < 5) -# remirepo:7 +# remirepo:8 %else Requires: php-composer(doctrine/dbal) < 3 Requires: php-composer(doctrine/dbal) >= 2.6 @@ -152,6 +153,7 @@ Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch1 -p1 : Cleanup to get rid of ocramius/package-versions %patch0 -p1 -b .rpm @@ -255,6 +257,7 @@ exit $ret - update to 2.0.0 - raise dependency on symfony 3.4 - add dependency on symfony/stopwatch 3.4 +- open https://github.com/doctrine/migrations/pull/802 32-bit tests * Thu Jan 3 2019 Remi Collet - 1.8.1-2 - move autoloader in Doctrine/DBAL/Migration -- cgit