HomePhabricator

Fix PhutilUTF8TestCase::testUTF8Convert for PHP 8

Description

Fix PhutilUTF8TestCase::testUTF8Convert for PHP 8

Summary:
In PHP 8 passing an invalid encoding to mb_convert_encoding raises a
ValueError (which extends Error not Exception), so fix the test to also
catch Throwable (but leave the explicit Exception case for PHP 5, which
lacks Throwable).

Test Plan: Ran arc unit --everything

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: Korvin

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21501

Details

Provenance
jrtc27Authored on Jan 11 2021, 4:49 AM
industryPushed on Jan 11 2021, 4:49 AM
Reviewer
Blessed Reviewers
Differential Revision
D21501: Fix PhutilUTF8TestCase::testUTF8Convert for PHP 8
Parents
rARC687cb41ace6c: Fix ArcanistFormattedStringXHPASTLinterRule on older PHP after D21500
Branches
Unknown
Tags
Unknown
Tasks
T13588: PHP 8 Compatibility
Build Status
Buildable 24998
Build 34488: Run Core Tests