‪TYPO3CMS  9.5
PluginHookTest.php
Go to the documentation of this file.
1 <?php
2 
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪PluginHookTest extends UnitTestCase
25 {
29  protected ‪$resetSingletonInstances = true;
30 
35  {
36  $searchResult = [
37  'count' => 0,
38  'rows' => []
39  ];
40 
41  $result = (new ‪PluginHook())->getDisplayResults_postProc($searchResult);
42  self::assertSame($searchResult, $result);
43  }
44 
49  {
50  $searchResult = [
51  'count' => 2,
52  'rows' => [
53  ['description' => 'I am a description field with joe and foo.'],
54  ['description' => 'Description will be modified to two bar. foo, bar, joe. ']
55  ]
56  ];
57 
58  $expected = [
59  'count' => 2,
60  'rows' => [
61  ['description' => 'I am a description field with joe and bar.'],
62  ['description' => 'Description will be modified to two bar. bar, bar, joe. ']
63  ]
64  ];
65 
66  $result = (new ‪PluginHook())->getDisplayResults_postProc($searchResult);
67  self::assertSame($expected, $result);
68  }
69 }
‪TYPO3\CMS\IndexedSearch\Tests\Unit\Example\PluginHookTest\getDisplayResults_postProcReturnsTheOriginalSearchResultBecauseOfMissingItems
‪getDisplayResults_postProcReturnsTheOriginalSearchResultBecauseOfMissingItems()
Definition: PluginHookTest.php:33
‪TYPO3\CMS\IndexedSearch\Tests\Unit\Example
Definition: PluginHookTest.php:3
‪TYPO3\CMS\IndexedSearch\Tests\Unit\Example\PluginHookTest
Definition: PluginHookTest.php:25
‪TYPO3\CMS\IndexedSearch\Tests\Unit\Example\PluginHookTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: PluginHookTest.php:28
‪TYPO3\CMS\IndexedSearch\Tests\Unit\Example\PluginHookTest\getDisplayResults_postProcModifiesTheDescriptionInARowOfSearchResult
‪getDisplayResults_postProcModifiesTheDescriptionInARowOfSearchResult()
Definition: PluginHookTest.php:47
‪TYPO3\CMS\IndexedSearch\Example\PluginHook
Definition: PluginHook.php:27