Skip to content

Commit 3c8dcbb

Browse files
committed
Updated the tests
1 parent 0bddc61 commit 3c8dcbb

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/HierarchicalFacetHelperTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,48 +58,55 @@ class HierarchicalFacetHelperTest extends \PHPUnit\Framework\TestCase
5858
'count' => 1000,
5959
'operator' => 'OR',
6060
'isApplied' => false,
61+
'isExcluded' => false,
6162
],
6263
[
6364
'value' => '0/AV/',
6465
'displayText' => 'Audiovisual',
6566
'count' => 600,
6667
'operator' => 'OR',
6768
'isApplied' => false,
69+
'isExcluded' => false,
6870
],
6971
[
7072
'value' => '0/Audio/',
7173
'displayText' => 'Sound',
7274
'count' => 400,
7375
'operator' => 'OR',
7476
'isApplied' => false,
77+
'isExcluded' => false,
7578
],
7679
[
7780
'value' => '1/Book/BookPart/',
7881
'displayText' => 'Book Part',
7982
'count' => 300,
8083
'operator' => 'OR',
8184
'isApplied' => false,
85+
'isExcluded' => false,
8286
],
8387
[
8488
'value' => '1/Book/Section/',
8589
'displayText' => 'Book Section',
8690
'count' => 200,
8791
'operator' => 'OR',
8892
'isApplied' => false,
93+
'isExcluded' => false,
8994
],
9095
[
9196
'value' => '1/Audio/Spoken/',
9297
'displayText' => 'Spoken Text',
9398
'count' => 100,
9499
'operator' => 'OR',
95100
'isApplied' => false,
101+
'isExcluded' => false,
96102
],
97103
[
98104
'value' => '1/Audio/Music/',
99105
'displayText' => 'Music',
100106
'count' => 50,
101107
'operator' => 'OR',
102108
'isApplied' => false,
109+
'isExcluded' => false,
103110
],
104111
];
105112

@@ -115,20 +122,23 @@ class HierarchicalFacetHelperTest extends \PHPUnit\Framework\TestCase
115122
'count' => 1000,
116123
'operator' => 'OR',
117124
'isApplied' => false,
125+
'isExcluded' => false,
118126
],
119127
[
120128
'value' => 'AV',
121129
'displayText' => 'Audiovisual',
122130
'count' => 600,
123131
'operator' => 'OR',
124132
'isApplied' => false,
133+
'isExcluded' => false,
125134
],
126135
[
127136
'value' => 'Audio',
128137
'displayText' => 'Sound',
129138
'count' => 400,
130139
'operator' => 'OR',
131140
'isApplied' => false,
141+
'isExcluded' => false,
132142
],
133143
];
134144

@@ -510,6 +520,7 @@ public function testHierarchicalExcludeFilters(): void
510520
'href' => '',
511521
'exclude' => '',
512522
'children' => [],
523+
'isExcluded' => false,
513524
],
514525
[
515526
'value' => '0/Audio/',
@@ -535,8 +546,10 @@ public function testHierarchicalExcludeFilters(): void
535546
'href' => '',
536547
'exclude' => '',
537548
'children' => [],
549+
'isExcluded' => false,
538550
],
539551
],
552+
'isExcluded' => false,
540553
],
541554
];
542555
$options = $this->getMockOptions();
@@ -588,6 +601,7 @@ public function testHierarchicalFacetFilters(): void
588601
'href' => '',
589602
'exclude' => '',
590603
'children' => [],
604+
'isExcluded' => false,
591605
],
592606
[
593607
'value' => '1/Audio/Music/',
@@ -601,8 +615,10 @@ public function testHierarchicalFacetFilters(): void
601615
'href' => '',
602616
'exclude' => '',
603617
'children' => [],
618+
'isExcluded' => false,
604619
],
605620
],
621+
'isExcluded' => false,
606622
],
607623
];
608624
$options = $this->getMockOptions();

module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/ResultsTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,15 @@ public function testGetFacetList(): void
276276
'count' => 16,
277277
'operator' => 'AND',
278278
'isApplied' => false,
279+
'isExcluded' => false,
279280
],
280281
[
281282
'value' => 'Psychotherapy',
282283
'displayText' => 'Psychotherapy',
283284
'count' => 8,
284285
'operator' => 'AND',
285286
'isApplied' => false,
287+
'isExcluded' => false,
286288
],
287289
],
288290
],
@@ -304,13 +306,15 @@ public function testGetFacetList(): void
304306
'count' => 16,
305307
'operator' => 'OR',
306308
'isApplied' => false,
309+
'isExcluded' => false,
307310
],
308311
[
309312
'value' => 'Psychotherapy',
310313
'displayText' => 'Psychotherapy',
311314
'count' => 8,
312315
'operator' => 'OR',
313316
'isApplied' => false,
317+
'isExcluded' => false,
314318
],
315319
],
316320
],
@@ -332,13 +336,15 @@ public function testGetFacetList(): void
332336
'count' => 16,
333337
'operator' => 'OR',
334338
'isApplied' => true,
339+
'isExcluded' => false,
335340
],
336341
[
337342
'value' => 'Psychotherapy',
338343
'displayText' => 'Psychotherapy',
339344
'count' => 8,
340345
'operator' => 'OR',
341346
'isApplied' => false,
347+
'isExcluded' => false,
342348
],
343349
],
344350
],
@@ -375,8 +381,10 @@ public function testGetFacetList(): void
375381
'href' => '',
376382
'exclude' => '',
377383
'children' => [],
384+
'isExcluded' => false,
378385
],
379386
],
387+
'isExcluded' => false,
380388
],
381389
[
382390
'value' => '0/Sub/',
@@ -390,6 +398,7 @@ public function testGetFacetList(): void
390398
'href' => '',
391399
'exclude' => '',
392400
'children' => [],
401+
'isExcluded' => false,
393402
],
394403
],
395404
],

module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/FacetFormatterTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ protected function getFakeFacetData($includeOr = false)
6363
'count' => 100,
6464
'operator' => 'AND',
6565
'isApplied' => false,
66+
'isExcluded' => false,
6667
],
6768
[
6869
'value' => 'baz',
6970
'displayText' => 'translated(baz)',
7071
'count' => 150,
7172
'operator' => 'AND',
7273
'isApplied' => true,
74+
'isExcluded' => false,
7375
],
7476
],
7577
],
@@ -82,20 +84,23 @@ protected function getFakeFacetData($includeOr = false)
8284
'count' => 10,
8385
'operator' => 'OR',
8486
'isApplied' => false,
87+
'isExcluded' => false,
8588
],
8689
[
8790
'value' => 'val2',
8891
'displayText' => 'translated(val2)',
8992
'count' => 15,
9093
'operator' => 'OR',
9194
'isApplied' => true,
95+
'isExcluded' => false,
9296
],
9397
[
9498
'value' => 'val3',
9599
'displayText' => 'translated(val3)',
96100
'count' => 5,
97101
'operator' => 'OR',
98102
'isApplied' => true,
103+
'isExcluded' => false,
99104
],
100105
],
101106
],
@@ -124,13 +129,15 @@ protected function getFakeHierarchicalFacetData($request, $includeOr = false)
124129
'count' => 100,
125130
'operator' => 'AND',
126131
'isApplied' => false,
132+
'isExcluded' => false,
127133
],
128134
[
129135
'value' => '1/bar/cookie/',
130136
'displayText' => 'translated(cookie)',
131137
'count' => 150,
132138
'operator' => 'AND',
133139
'isApplied' => true,
140+
'isExcluded' => false,
134141
],
135142
],
136143
'hierarchical_xyzzy' => [
@@ -140,13 +147,15 @@ protected function getFakeHierarchicalFacetData($request, $includeOr = false)
140147
'count' => 10,
141148
'operator' => 'OR',
142149
'isApplied' => false,
150+
'isExcluded' => false,
143151
],
144152
[
145153
'value' => '1/val1/val2/',
146154
'displayText' => 'translated(val2)',
147155
'count' => 15,
148156
'operator' => 'OR',
149157
'isApplied' => true,
158+
'isExcluded' => false,
150159
],
151160
],
152161
];

0 commit comments

Comments
 (0)