unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 67902@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#67902] [PATCH 72/95] gnu: Add php-symfony-phpunit-bridge.
Date: Tue, 19 Dec 2023 14:57:53 +0100	[thread overview]
Message-ID: <20231219140934.22783-72-ngraves@ngraves.fr> (raw)
In-Reply-To: <20231219140934.22783-1-ngraves@ngraves.fr>

* gnu/packages/php-xyz.scm  (php-symfony-phpunit-bridge): New variable.
* gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch:
New file.

Change-Id: Ie72bd332a6fb7aaf96a59ce24e6008e6aa599f59
---
 ...ymfony-phpunit-bridge-getVendors-fix.patch | 46 +++++++++++
 gnu/packages/php-xyz.scm                      | 77 +++++++++++++++++++
 2 files changed, 123 insertions(+)
 create mode 100644 gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch

diff --git a/gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch b/gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch
new file mode 100644
index 0000000000..fd48e2ce6c
--- /dev/null
+++ b/gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch
@@ -0,0 +1,46 @@
+From 4b7c29c3e98aa55ea7567a3d496595e539f30cdb Mon Sep 17 00:00:00 2001
+From: Nicolas Graves <ngraves@ngraves.fr>
+Date: Sun, 22 Oct 2023 16:31:40 +0200
+Subject: [PATCH] Deprecation.php: Do not check for composer in getVendors.
+
+---
+ DeprecationErrorHandler/Deprecation.php | 23 ++---------------------
+ 1 file changed, 2 insertions(+), 21 deletions(-)
+
+diff --git a/DeprecationErrorHandler/Deprecation.php b/DeprecationErrorHandler/Deprecation.php
+index 79cfa0c..b7074f7 100644
+--- a/DeprecationErrorHandler/Deprecation.php
++++ b/DeprecationErrorHandler/Deprecation.php
+@@ -365,27 +365,8 @@ class Deprecation
+             if (class_exists(DebugClassLoader::class, false)) {
+                 self::$vendors[] = \dirname((new \ReflectionClass(DebugClassLoader::class))->getFileName());
+             }
+-            foreach (get_declared_classes() as $class) {
+-                if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
+-                    $r = new \ReflectionClass($class);
+-                    $v = \dirname($r->getFileName(), 2);
+-                    if (file_exists($v.'/composer/installed.json')) {
+-                        self::$vendors[] = $v;
+-                        $loader = require $v.'/autoload.php';
+-                        $paths = self::addSourcePathsFromPrefixes(
+-                            array_merge($loader->getPrefixes(), $loader->getPrefixesPsr4()),
+-                            $paths
+-                        );
+-                    }
+-                }
+-            }
+-            foreach ($paths as $path) {
+-                foreach (self::$vendors as $vendor) {
+-                    if (0 !== strpos($path, $vendor)) {
+-                        self::$internalPaths[] = $path;
+-                    }
+-                }
+-            }
++            self::$vendors[] = $v;
++            self::$internalPaths[] = $paths;
+         }
+ 
+         return self::$vendors;
+-- 
+2.41.0
+
diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm
index 6cd3295b85..d6a49d1f75 100644
--- a/gnu/packages/php-xyz.scm
+++ b/gnu/packages/php-xyz.scm
@@ -1954,3 +1954,80 @@ (define-public php-symfony-mime
     (home-page "https://symfony.com")
     (license license:expat)))
 
+(define-public php-symfony-phpunit-bridge
+  (package
+    (name "php-symfony-phpunit-bridge")
+    (version "6.3.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/symfony/phpunit-bridge")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1v5zdjb0d7282wq0ghwzn9x005wqlzjmx2msi9vhp1c4l513fxgf"))
+       (patches
+        (search-patches "php-symfony-phpunit-bridge-getVendors-fix.patch"))))
+    (build-system composer-build-system)
+    (arguments
+     (list
+      #:test-flags  ; Some tests are useless but get reported as risky.
+      ''("--bootstrap" "vendor/autoload.php" "--dont-report-useless-tests")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'deactivate-bootstrap.php
+            (lambda _
+              (substitute* "composer.json"
+                ((".*\"files\".*")
+                 ""))))
+          (add-before 'check 'pre-check
+            (lambda* (#:key inputs #:allow-other-keys)
+              ;; Adapt some PHP test code to Guix context.
+              (mkdir-p
+               (string-append (getcwd) "/vendor/myfakevendor/myfakepackage1"))
+              (substitute* "Tests/DeprecationErrorHandler/DeprecationTest.php"
+                (("(.*)self::\\$vendorDir = \\$vendorDir;" all blank)
+                 (string-append
+                  blank "$vendorDir = '" (getcwd) "/vendor/';\n"
+                  all)))
+              (substitute* "DeprecationErrorHandler/Deprecation.php"
+                (("(self::\\$vendors\\[\\] = )\\$v;" all eq)
+                 (string-append eq "'" (getcwd) "/vendor';"))
+                (("(self::\\$internalPaths)\\[\\] = \\$paths;" all def)
+                 (string-append
+                  def " = ["
+                  "'" (getcwd) "/Tests/DeprecationErrorHandler/Deprecation.php',"
+                  "'" (getcwd) "/Tests/DeprecationErrorHandler/DeprecationTest.php',"
+                  "'" (getcwd) "/Tests/DeprecationErrorHandler.php',"
+                  "];")))
+              ;; Remove failing tests. All but two are probably failing
+              ;; because of some version mismatch of php-symfony-error-handler.
+              (for-each
+               (lambda (f)
+                 (delete-file
+                  (string-append "Tests/DeprecationErrorHandler/" f)))
+               '("partially_quiet.phpt"
+                 "partially_quiet2.phpt"
+                 "trigger_deprecation_types.phpt"
+                 "trigger_error_types.phpt"
+                 "weak_vendors_on_vendor.phpt"))
+              (delete-file "Tests/CoverageListenerTest.php")
+              ;; For most simple cases, handle php-symfony-error-handler
+              ;; discrepancies.
+              (substitute* (find-files "Tests" "\\.phpt")
+                (("Remaining indirect deprecation notices")
+                 "Other deprecation notices")
+                (("Remaining direct deprecation notices")
+                 "Other deprecation notices")))))))
+    (native-inputs
+     (list php-phpunit-phpunit
+           php-symfony-deprecation-contracts
+           php-symfony-error-handler))
+    (synopsis "Utilities for PHPUnit")
+    (description
+     "This package provides utilities for PHPUnit, especially user deprecation
+notices management.")
+    (home-page "https://symfony.com")
+    (license license:expat)))
+
-- 
2.41.0





  parent reply	other threads:[~2023-12-19 14:43 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 13:42 [bug#67902] [PATCH 00/95] PHP package chain Nicolas Graves via Guix-patches via
2023-12-19 13:56 ` [bug#67902] [PATCH 01/95] gnu: Add abnfgen Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 02/95] gnu: php-xyz: Add copyright and useful modules Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 03/95] gnu: Add php-cache-tag-interop Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 04/95] gnu: Add php-doctrine-collections Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 05/95] gnu: Add php-doctrine-common Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 06/95] gnu: Add php-doctrine-deprecations Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 07/95] gnu: Add php-doctrine-event-manager Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 08/95] gnu: Add php-doctrine-instantiator Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 09/95] gnu: Add php-doctrine-lexer Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 10/95] gnu: Add php-doctrine-persistence Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 11/95] gnu: Add php-dms-phpunit-arraysubset-asserts Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 12/95] gnu: Add php-egulias-email-validator Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 13/95] gnu: Add php-fig-log-test Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 14/95] gnu: Add php-hamcrest-hamcrest-php Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 15/95] gnu: Add php-mockery-mockery Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 16/95] gnu: Add php-myclabs-deep-copy Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 17/95] gnu: Add php-nikic-php-parser Nicolas Graves via Guix-patches via
2023-12-19 13:56   ` [bug#67902] [PATCH 18/95] gnu: Add php-phar-io-manifest Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 19/95] gnu: Add php-phar-io-version Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 20/95] gnu: Add php-phpdocumentor-reflection-common Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 21/95] gnu: Add php-phpdocumentor-reflection-docblock Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 22/95] gnu: Add php-phpdocumentor-type-resolver Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 23/95] gnu: Add php-phpspec-prophecy Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 24/95] gnu: Add php-phpstan-phpdoc-parser Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 25/95] gnu: Add php-phpunit-php-code-coverage Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 26/95] gnu: Add php-phpunit-php-file-iterator Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 27/95] gnu: Add php-phpunit-php-invoker Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 28/95] gnu: Add php-phpunit-php-timer Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 29/95] gnu: Add php-phpunit-php-text-template Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 30/95] gnu: Add php-phpunit-php-token-stream Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 31/95] gnu: Add php-predis-predis Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 32/95] gnu: Add php-psr-log Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 33/95] gnu: Add php-psr-cache Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 34/95] gnu: Add php-psr-cache-1 Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 35/95] gnu: Add php-psr-container Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 36/95] gnu: Add php-psr-event-dispatcher Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 37/95] gnu: Add php-psr-simple-cache Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 38/95] gnu: Add php-sebastian-cli-parser Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 39/95] gnu: Add php-sebastian-code-unit Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 40/95] gnu: Add php-sebastian-code-unit-reverse-lookup Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 41/95] gnu: Add php-sebastian-comparator Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 42/95] gnu: Add php-sebastian-complexity Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 43/95] gnu: Add php-sebastian-diff Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 44/95] gnu: Add php-sebastian-environment Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 45/95] gnu: Add php-sebastian-exporter Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 46/95] gnu: Add php-sebastian-global-state Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 47/95] gnu: Add php-sebastian-lines-of-code Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 48/95] gnu: Add php-sebastian-object-enumerator Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 49/95] gnu: Add php-sebastian-object-reflector Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 50/95] gnu: Add php-sebastian-recursion-context Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 51/95] gnu: Add php-sebastian-resource-operations Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 52/95] gnu: Add php-sebastian-type Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 53/95] gnu: Add php-sebastian-version Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 54/95] gnu: Add php-symfony-cache Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 55/95] gnu: Add php-cache-integration-tests Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 56/95] gnu: Add php-symfony-cache-contracts Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 57/95] gnu: Add php-symfony-config Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 58/95] gnu: Add php-symfony-console Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 59/95] gnu: Add php-symfony-dependency-injection Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 60/95] gnu: Add php-symfony-deprecation-contracts Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 61/95] gnu: Add php-symfony-error-handler Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 62/95] gnu: Add php-symfony-event-dispatcher Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 63/95] gnu: Add php-symfony-event-dispatcher-contracts Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 64/95] gnu: Add php-symfony-expression-language Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 65/95] gnu: Add php-symfony-filesystem Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 66/95] gnu: Add php-symfony-finder Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 67/95] gnu: Add php-symfony-http-foundation Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 68/95] gnu: Add php-symfony-http-kernel Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 69/95] gnu: Add php-symfony-intl Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 70/95] gnu: Add php-symfony-lock Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 71/95] gnu: Add php-symfony-mime Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` Nicolas Graves via Guix-patches via [this message]
2023-12-19 13:57   ` [bug#67902] [PATCH 73/95] gnu: Add php-symfony-process Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 74/95] gnu: Add php-symfony-property-info Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 75/95] gnu: Add php-symfony-polyfill-ctype Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 76/95] gnu: Add php-symfony-polyfill-intl-grapheme Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 77/95] gnu: Add php-symfony-polyfill-intl-idn Nicolas Graves via Guix-patches via
2023-12-19 13:57   ` [bug#67902] [PATCH 78/95] gnu: Add php-symfony-polyfill-intl-normalizer Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 79/95] gnu: Add php-symfony-polyfill-mbstring Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 80/95] gnu: Add php-symfony-polyfill-uuid Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 81/95] gnu: Add php-symfony-service-contracts Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 82/95] gnu: Add php-symfony-stopwatch Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 83/95] gnu: Add php-symfony-string Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 84/95] gnu: Add php-symfony-translation-contracts Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 85/95] gnu: Add php-symfony-uid Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 86/95] gnu: Add php-symfony-var-dumper Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 87/95] gnu: Add php-symfony-var-exporter Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 88/95] gnu: Add php-symfony-yaml Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 89/95] gnu: Add php-doctrine-cache Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 90/95] gnu: Add php-doctrine-annotations Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 91/95] gnu: Add php-doctrine-dbal Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 92/95] gnu: Add php-theseer-tokenizer Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 93/95] gnu: Add php-twig-twig Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 94/95] gnu: Add php-webmozart-assert Nicolas Graves via Guix-patches via
2023-12-19 13:58   ` [bug#67902] [PATCH 95/95] gnu: Add php-phpunit-phpunit Nicolas Graves via Guix-patches via
2023-12-19 20:15 ` [bug#67902] [PATCH 02/95 v2] gnu: php-xyz: Add copyright and useful modules Nicolas Graves via Guix-patches via
2024-03-23 16:36 ` [bug#67902] [PATCH 00/95] PHP package chain Wilko Meyer
2024-04-05 20:12   ` Ludovic Courtès
2024-04-05 22:43     ` Nicolas Graves via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231219140934.22783-72-ngraves@ngraves.fr \
    --to=guix-patches@gnu.org \
    --cc=67902@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).