Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759445 - dev-php/phpunit-5.7.15-r3: Call to undefined function each
Summary: dev-php/phpunit-5.7.15-r3: Call to undefined function each
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2020-12-11 07:32 UTC by Agostino Sarubbo
Modified: 2023-09-15 07:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,8.47 KB, text/plain)
2020-12-11 07:32 UTC, Agostino Sarubbo
Details
phpunit-5.7-noeach.patch (phpunit-5.7-noeach.patch,2.75 KB, patch)
2020-12-11 21:09 UTC, Brian Evans (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-12-11 07:32:05 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-php/php-redmine-api-1.5.16 fails tests.
Discovered on: amd64 (internal ref: ci)
Comment 1 Agostino Sarubbo gentoo-dev 2020-12-11 07:32:07 UTC
Created attachment 677809 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2020-12-11 07:32:08 UTC
Possible context of error(s):

PHP Fatal error:  Uncaught Error: Call to undefined function each() in /usr/share/php/PHPUnit/Util/Getopt.php:37
Comment 3 Michael Orlitzky gentoo-dev 2020-12-11 14:48:21 UTC
This is a problem with PHPUnit (I'm guessing 5.x based on the DEPEND of php-redmine-api) and not php-redmine-api:

PHP Fatal error:  Uncaught Error: Call to undefined function each() in /usr/share/php/PHPUnit/Util/Getopt.php:37
Stack trace:
#0 /usr/share/php/PHPUnit/TextUI/Command.php(279): PHPUnit_Util_Getopt::getopt()
#1 /usr/share/php/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->handleArguments()
#2 /usr/share/php/PHPUnit/TextUI/Command.php(118): PHPUnit_TextUI_Command->run()
#3 /usr/share/php/PHPUnit/phpunit(52): PHPUnit_TextUI_Command::main()
#4 {main}
  thrown in /usr/share/php/PHPUnit/Util/Getopt.php on line 37
Comment 4 Brian Evans (RETIRED) gentoo-dev 2020-12-11 21:09:29 UTC
Created attachment 678022 [details, diff]
phpunit-5.7-noeach.patch

Proposed patch to remove each from PHPUnit 5.7.15-r3

Signed-off-by: Brian Evans <grknight@gentoo.org>
Comment 5 Michael Orlitzky gentoo-dev 2020-12-11 21:26:32 UTC
This is a hard problem to solve in general: ago is running the test suite with php-8.x even though this version of PHPUnit needs php-7.x. There's no _general_ way to solve that with our PHP eclasses if I recall correctly... but in this case, phpunit-5.x needs EXACTLY php:7.2.

Could we just change the shebang in "phpunit" to point to /usr/bin/php7.2 instead of /usr/bin/php?
Comment 6 Brian Evans (RETIRED) gentoo-dev 2020-12-11 21:28:43 UTC
(In reply to Michael Orlitzky from comment #5)
> This is a hard problem to solve in general: ago is running the test suite
> with php-8.x even though this version of PHPUnit needs php-7.x. There's no
> _general_ way to solve that with our PHP eclasses if I recall correctly...
> but in this case, phpunit-5.x needs EXACTLY php:7.2.
> 
> Could we just change the shebang in "phpunit" to point to /usr/bin/php7.2
> instead of /usr/bin/php?

So this is a real problem then as 7.2 is due to retire this month as soon as the next security release is due.  7.2 is EOL upstrea as of 2020-11-30
Comment 7 Michael Orlitzky gentoo-dev 2020-12-11 21:34:29 UTC
Maybe port it to 7.3 and then proceed with shebang-changing? Or we could also try to replace phpunit-5.x with something only slightly newer.

The latest version of e.g. php-redmine-api still asks for phpunit-6.x, but could probably use something newer. (If everything has a newer version that can use phpunit-8.x, no problem.)
Comment 8 Larry the Git Cow gentoo-dev 2023-09-15 07:52:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a015f3cf2cdf6d9cadda572bc80865558a59de9f

commit a015f3cf2cdf6d9cadda572bc80865558a59de9f
Author:     David Seifert <soap@gentoo.org>
AuthorDate: 2023-09-15 07:52:20 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2023-09-15 07:52:20 +0000

    dev-php/phpunit: treeclean
    
    Closes: https://bugs.gentoo.org/715772
    Closes: https://bugs.gentoo.org/759445
    Signed-off-by: David Seifert <soap@gentoo.org>

 dev-php/phpunit/Manifest              |  2 -
 dev-php/phpunit/metadata.xml          | 12 -----
 dev-php/phpunit/phpunit-8.5.11.ebuild | 96 ----------------------------------
 dev-php/phpunit/phpunit-8.5.14.ebuild | 97 -----------------------------------
 profiles/package.mask                 |  1 -
 5 files changed, 208 deletions(-)