Skip to content

Commit

Permalink
Merge pull request #25131 from totten/master-symbols-test
Browse files Browse the repository at this point in the history
(NFC) dev/core#4008 - Afform - More coverage for symbol-scanner
  • Loading branch information
colemanw authored Dec 8, 2022
2 parents b9a0f2e + 6468a19 commit bb6e17c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ext/afform/core/tests/phpunit/Civi/Afform/SymbolsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ public function getExamples() {
],
],
];
$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.
'<div class="my-parent" ng-if="a<b"><div ng-if="c && d" class="my-child"><img ng-if="e > f" class="special" src="foo.png"/></div></div>',
[
'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[] = [
'<blink>aw<fulmark&up<img><img><area></amap></blink>',
[
'e' => ['body' => 1, 'blink' => 1, 'fulmark' => 1, 'img' => 1, 'area' => 1],
'a' => [],
'c' => [],
],
];
$exs[] = [
'<div class="my-parent foo bar">a<div class="my-child whiz bang {{ghost + stuff}} last">b</div>c</div>',
[
Expand Down

0 comments on commit bb6e17c

Please sign in to comment.