From 6468a19022d0bfa60e45c48bcefa1a5b04e5a04e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 7 Dec 2022 13:45:49 -0800 Subject: [PATCH] (NFC) dev/core#4008 - Afform - More coverage for symbol-scanner Add more test-coverage. This reproduces the failure-scenario that was addressed by #25067. (When combined with 25067, it passes. But before 25067, it fails.) --- .../tests/phpunit/Civi/Afform/SymbolsTest.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ext/afform/core/tests/phpunit/Civi/Afform/SymbolsTest.php b/ext/afform/core/tests/phpunit/Civi/Afform/SymbolsTest.php index f81d8795eb..f84abbd1e6 100644 --- a/ext/afform/core/tests/phpunit/Civi/Afform/SymbolsTest.php +++ b/ext/afform/core/tests/phpunit/Civi/Afform/SymbolsTest.php @@ -50,6 +50,27 @@ class SymbolsTest extends \PHPUnit\Framework\TestCase implements HeadlessInterfa ], ], ]; + $exs[] = [ + // These are ordinary ng-if's in Angular, but libxml likes to warn about '&&' and '<'. Let's make we're still able to parse them. + '
', + [ + 'e' => ['div' => 2, 'img' => 1, 'body' => 1], + 'a' => ['class' => 3, 'src' => 1, 'ng-if' => 3], + 'c' => [ + 'my-parent' => 1, + 'my-child' => 1, + 'special' => 1, + ], + ], + ]; + $exs[] = [ + 'aw', + [ + 'e' => ['body' => 1, 'blink' => 1, 'fulmark' => 1, 'img' => 1, 'area' => 1], + 'a' => [], + 'c' => [], + ], + ]; $exs[] = [ '
a
b
c
', [ -- 2.25.1