public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/php-mockery] f43: refresh patch
@ 2026-08-25 10:33 Remi Collet
  0 siblings, 0 replies; only message in thread
From: Remi Collet @ 2026-08-25 10:33 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/php-mockery
            Branch : f43
            Commit : 9a184899ae92f0de1e0e04b42ec961dc7bf540d9
            Author : Remi Collet <remi@fedoraproject.org>
            Date   : 2026-08-25T12:33:24+02:00
            Stats  : +49/-16 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/php-mockery/c/9a184899ae92f0de1e0e04b42ec961dc7bf540d9?branch=f43

            Log:
            refresh patch

(cherry picked from commit c6f29165fc956f569e0bc5efb6806143ef079194)

---
diff --git a/mockery-tests.patch b/mockery-tests.patch
index 3019204..8c63032 100644
--- a/mockery-tests.patch
+++ b/mockery-tests.patch
@@ -1,18 +1,51 @@
 diff -up ./tests/Bootstrap.php.rpm ./tests/Bootstrap.php
---- ./tests/Bootstrap.php.rpm	2018-05-08 10:54:48.000000000 +0200
-+++ ./tests/Bootstrap.php	2018-05-13 10:39:38.471383840 +0200
-@@ -50,11 +50,9 @@ if (!file_exists($autoloadPath)) {
- 
- require_once $autoloadPath;
- 
--$hamcrestRelativePath = 'hamcrest/hamcrest-php/hamcrest/Hamcrest.php';
--if (DIRECTORY_SEPARATOR !== '/') {
--    $hamcrestRelativePath = str_replace('/', DIRECTORY_SEPARATOR, $hamcrestRelativePath);
--}
--$hamcrestPath = $composerVendorDirectory . DIRECTORY_SEPARATOR . $hamcrestRelativePath;
-+require_once __DIR__ . '/classmap.php';
-+
-+$hamcrestPath = '/usr/share/php/Hamcrest2/Hamcrest.php';
- 
- require_once $hamcrestPath;
+--- ./tests/Bootstrap.php.rpm	2026-08-25 11:01:39.000000000 +0200
++++ ./tests/Bootstrap.php	2026-08-25 11:39:03.724218665 +0200
+@@ -46,47 +46,3 @@ if (! \function_exists('vdd')) {
+     }
+ }
  
+-(static function (string $rootDir): void {
+-    $classLoader = require \implode(DIRECTORY_SEPARATOR, [$rootDir, 'vendor', 'autoload.php']);
+-    if (! $classLoader instanceof ClassLoader) {
+-        throw new RuntimeException('Unable to load ' . ClassLoader::class);
+-    }
+-
+-    $hamcrestPath = \implode(
+-        DIRECTORY_SEPARATOR,
+-        [$rootDir, 'vendor', 'hamcrest', 'hamcrest-php', 'hamcrest', 'Hamcrest.php']
+-    );
+-    if (\file_exists($hamcrestPath)) {
+-        require_once $hamcrestPath;
+-    }
+-
+-    $testsDir = \implode(DIRECTORY_SEPARATOR, [$rootDir, 'tests']);
+-    if (! \is_dir($testsDir)) {
+-        throw new RuntimeException('Unable to find tests directory: ' . $testsDir);
+-    }
+-
+-    $fixtureDir = \implode(DIRECTORY_SEPARATOR, [$testsDir, 'Fixture']);
+-    if (! \is_dir($fixtureDir)) {
+-        throw new RuntimeException('Unable to find fixture directory: ' . $fixtureDir);
+-    }
+-
+-    // Add autoloading for the fixture classes
+-    $classLoader->add('', $fixtureDir . DIRECTORY_SEPARATOR . 'Namespaced');
+-    $versions = ['PHP73', 'PHP74', 'PHP80', 'PHP81', 'PHP82', 'PHP83', 'PHP84', 'PHP85', 'PHP86'];
+-    foreach ($versions as $version) {
+-        $classLoader->addPsr4($version . '\\', $fixtureDir . DIRECTORY_SEPARATOR . $version);
+-    }
+-    // $classLoader->addPsr4('Tests\\Unit\\', $testsDir . DIRECTORY_SEPARATOR . 'Unit');
+-
+-    $debug = false;
+-    // If debug is enabled, set up a loader for Mockery to use for generated mock classes
+-    if ($debug) {
+-        $mocksDirectory = \implode(DIRECTORY_SEPARATOR, [$testsDir, '_mocks']);
+-
+-        if (! \file_exists($mocksDirectory)) {
+-            \mkdir($mocksDirectory, 0777, true);
+-        }
+-
+-        Mockery::setLoader(new RequireLoader($mocksDirectory));
+-    }
+-})(\dirname(__DIR__));

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-25 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-25 10:33 [rpms/php-mockery] f43: refresh patch Remi Collet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox