silverstripe-framework/src/Dev
Ingo Schommer 5e2ca7f0a3 FIX Tidy extension and cli fix for tests
Wrap doesn't actually wrap in the tidy extension.
This causes tests to be flakey, for example some of `FormTest` fails
if you happen to have `ext-tidy` installed (which is the default on most systems).
This happened to me on PHP 7.4.19 with tidy 5.6.0 (OSX Homebrew).
Note that the tests aren't failing in Travis right now.

You'd expect `wrap => 0` to be honoured. It's documented as an integer
in the tidy docs: https://api.html-tidy.org/tidy/quickref_5.6.0.html#wrap.

Even tracked this down to the PHP source which appears to be doing the right thing:
https://github.com/php/php-src/blob/master/ext/tidy/tidy.c#L300

There's a bug from 2018 against PHP 7.2.8 which was closed as "not a bug" without comment:
https://bugs.php.net/bug.php?id=76683

You can see the behaviour in action in the following test.

```
<?php
$html = '<p>a really long string which should not be wrapped</p>';

echo "## With tidy extension" . PHP_EOL;
$tidy = new tidy();
$tidy->parseString(
    $html,
    [
        'output-xhtml' => true,
        'numeric-entities' => true,
        'wrap' => 0,
    ],
    'utf8'
);
$tidy->cleanRepair();
echo $tidy . PHP_EOL;

echo "## With tidy cli" . PHP_EOL;
$cmd = sprintf("echo " . escapeshellarg($html) . " | tidy --force-output 1 -n -q -utf8 -asxhtml -w 0 2> /dev/null");
echo shell_exec($cmd);
```

Long story short, setting it to 99999 fixes the issue.
2021-05-20 20:09:42 +12:00
..
Constraint BUG Fix issue with assertListEquals() ignoring field getters 2019-01-11 11:35:11 +13:00
Install FIX Handle DatabaseAdapterRegistry cache exception 2020-08-03 10:57:27 +12:00
State Merge pull request #8241 from creative-commoners/pulls/4.3/separate-logging 2019-04-05 08:49:09 +13:00
Tasks Fix the phpdoc blocks 2020-12-21 22:23:23 +01:00
Backtrace.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
BehatFixtureFactory.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
BuildTask.php Fix the phpdoc blocks 2020-12-21 22:23:23 +01:00
BulkLoader_Result.php Use short array syntax across the framework's codebase 2020-05-16 10:34:45 +01:00
BulkLoader.php Use short array syntax across the framework's codebase 2020-05-16 10:34:45 +01:00
CLI.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
CliDebugView.php var_export does not handle circular references 2018-09-24 12:31:06 +02:00
CSSContentParser.php FIX Tidy extension and cli fix for tests 2021-05-20 20:09:42 +12:00
CsvBulkLoader.php ENH Replace E_USER_ERROR errors with exceptions 2020-09-24 23:51:21 -07:00
CSVParser.php Fix the phpdoc blocks 2020-12-21 22:23:23 +01:00
Debug.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
DebugView.php BUG Remove old boostrap 3 CSS class 2020-09-16 11:03:27 +12:00
Deprecation.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
DevBuildController.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
DevConfigController.php NEW Added a dev view to output the current config from dev/config (#9542) 2020-08-28 07:19:03 +12:00
DevConfirmationController.php Run PSR2 Lint cleaner 2019-10-04 13:26:31 +13:00
DevelopmentAdmin.php Merge branch '4.6' into 4 2020-10-05 14:03:05 +13:00
FixtureBlueprint.php Fix the phpdoc blocks 2020-12-21 22:23:23 +01:00
FixtureFactory.php Fix the phpdoc blocks 2020-12-21 22:23:23 +01:00
FunctionalTest.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
InstallerTest.php [CVE-2020-6164] Remove/deprecate unused controllers that can potentially give away some information about the underlying project. 2020-07-10 17:57:06 +12:00
MigrationTask.php Update description 2020-03-06 09:57:31 +13:00
SapphireInfo.php [CVE-2020-6164] Remove/deprecate unused controllers that can potentially give away some information about the underlying project. 2020-07-10 17:57:06 +12:00
SapphireTest.php FIX Don't swallow app init errors in test setup 2020-11-12 13:51:22 +13:00
SSListExporter.php API Rename assert dos to assert list 2017-10-09 11:53:11 +13:00
TaskRunner.php NEW: Improved task runner UI. (#9540) 2020-08-26 11:11:13 +12:00
TestKernel.php API Refactor bootstrap, request handling 2017-06-22 22:50:45 +12:00
TestMailer.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
TestOnly.php PSR2: Whitespace-only changes 2016-11-29 12:31:16 +13:00
TestSession_STResponseWrapper.php PSR2: Whitespace-only changes 2016-11-29 12:31:16 +13:00
TestSession.php Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
YamlFixture.php FIX Do not try and load fixtures from directories, fixes PHP 7.4 build errors 2019-07-26 10:13:47 +02:00