ezyang / ezyang/htmlpurifier

PHP 7.2: test suite errors

Open
#158 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
361
Avg merge
3d 41m
Merged PRs (30d)
2

Description

simpletest sometimes uses old-style "same name as class" constructors, which PHP 7.2 now warns about. This causes one test failure:

Unexpected PHP Error [Methods with the same name as their class will not be constructors in a future version of PHP; HTMLPurifier_DefinitionTestable has a deprecated constructor] severity [8192] in [simpletest/simpletest/mock_objects.php(1429) : eval()'d code line 1]
in test_get
in HTMLPurifier_DefinitionCache_Decorator_CleanupTest

(Additionally, if running with error_reporting at E_ALL, 4 Deprecated: warnings are printed at test suite startup with the same cause, but those don't cause test failures.)

The underlying issue seems to be in simpletest, so I reported that there as simpletest/simpletest#55

There's also one more "autoload" type problem that appears with E_ALL as well, because tests/common.php has its own separate autoloader. Since it's during test suite startup only, it doesn't cause a failure, though:

Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in HtmlPurifier/tests/common.php on line 10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/common.php line 10 and the failing path reported from simpletest/simpletest/mock_objects.php line 1429; review the linked simpletest issue for the old-style constructor behavior. Done means the test suite no longer fails on PHP 7.2 and the E_ALL startup output no longer includes the reported deprecation warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.