‪TYPO3CMS  ‪main
HookFixture.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
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 
22 
26 final class ‪HookFixture implements ‪SingletonInterface
27 {
28  private array ‪$invocations = [];
29 
30  public function ‪findInvocationsByMethodName(string $methodName): ?array
31  {
32  return $this->invocations[$methodName] ?? null;
33  }
34 
35  public function ‪processDatamap_beforeStart(‪DataHandler $dataHandler): void
36  {
37  $this->invocations[__FUNCTION__][] = true;
38  }
39 
43  public function ‪processDatamap_preProcessFieldArray(array $fieldArray, string $table, $id, ‪DataHandler $dataHandler): void
44  {
45  $this->invocations[__FUNCTION__][] = [
46  'fieldArray' => $fieldArray,
47  'table' => $table,
48  'id' => $id,
49  ];
50  }
51 
55  public function ‪processDatamap_postProcessFieldArray(string $status, string $table, $id, array $fieldArray, ‪DataHandler $dataHandler): void
56  {
57  $this->invocations[__FUNCTION__][] = [
58  'status' => $status,
59  'table' => $table,
60  'id' => $id,
61  'fieldArray' => $fieldArray,
62  ];
63  }
64 
68  public function ‪processDatamap_afterDatabaseOperations(string $status, string $table, $id, array $fieldArray, ‪DataHandler $dataHandler): void
69  {
70  $this->invocations[__FUNCTION__][] = [
71  'status' => $status,
72  'table' => $table,
73  'id' => $id,
74  'fieldArray' => $fieldArray,
75  ];
76  }
77 
78  public function ‪processDatamap_afterAllOperations(‪DataHandler $dataHandler): void
79  {
80  $this->invocations[__FUNCTION__][] = true;
81  }
82 
83  public function ‪processCmdmap_beforeStart(‪DataHandler $dataHandler): void
84  {
85  $this->invocations[__FUNCTION__][] = true;
86  }
87 
93  public function ‪processCmdmap_preProcess(string $command, string $table, $id, $value, ‪DataHandler $dataHandler, $pasteUpdate): void
94  {
95  $this->invocations[__FUNCTION__][] = [
96  'command' => $command,
97  'table' => $table,
98  'id' => $id,
99  'value' => $value,
100  'pasteUpdate' => $pasteUpdate,
101  ];
102  }
103 
109  public function ‪processCmdmap(string $command, string $table, $id, $value, bool $commandIsProcessed, ‪DataHandler $dataHandler, $pasteUpdate): void
110  {
111  $this->invocations[__FUNCTION__][] = [
112  'command' => $command,
113  'table' => $table,
114  'id' => $id,
115  'value' => $value,
116  'commandIsProcessed' => $commandIsProcessed,
117  'pasteUpdate' => $pasteUpdate,
118  ];
119  }
120 
127  public function ‪processCmdmap_postProcess(string $command, string $table, $id, $value, ‪DataHandler $dataHandler, $pasteUpdate, $pasteDatamap): void
128  {
129  $this->invocations[__FUNCTION__][] = [
130  'command' => $command,
131  'table' => $table,
132  'id' => $id,
133  'value' => $value,
134  'pasteUpdate' => $pasteUpdate,
135  'pasteDatamap' => $pasteDatamap,
136  ];
137  }
138 
139  public function ‪processCmdmap_afterFinish(‪DataHandler $dataHandler): void
140  {
141  $this->invocations[__FUNCTION__][] = true;
142  }
143 }
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:94
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processDatamap_afterDatabaseOperations
‪processDatamap_afterDatabaseOperations(string $status, string $table, $id, array $fieldArray, DataHandler $dataHandler)
Definition: HookFixture.php:68
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processDatamap_preProcessFieldArray
‪processDatamap_preProcessFieldArray(array $fieldArray, string $table, $id, DataHandler $dataHandler)
Definition: HookFixture.php:43
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures
Definition: HookFixture.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\$invocations
‪array $invocations
Definition: HookFixture.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\findInvocationsByMethodName
‪findInvocationsByMethodName(string $methodName)
Definition: HookFixture.php:30
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture
Definition: HookFixture.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processCmdmap_postProcess
‪processCmdmap_postProcess(string $command, string $table, $id, $value, DataHandler $dataHandler, $pasteUpdate, $pasteDatamap)
Definition: HookFixture.php:127
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processCmdmap_afterFinish
‪processCmdmap_afterFinish(DataHandler $dataHandler)
Definition: HookFixture.php:139
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processDatamap_postProcessFieldArray
‪processDatamap_postProcessFieldArray(string $status, string $table, $id, array $fieldArray, DataHandler $dataHandler)
Definition: HookFixture.php:55
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processDatamap_beforeStart
‪processDatamap_beforeStart(DataHandler $dataHandler)
Definition: HookFixture.php:35
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processCmdmap_preProcess
‪processCmdmap_preProcess(string $command, string $table, $id, $value, DataHandler $dataHandler, $pasteUpdate)
Definition: HookFixture.php:93
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processCmdmap_beforeStart
‪processCmdmap_beforeStart(DataHandler $dataHandler)
Definition: HookFixture.php:83
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processCmdmap
‪processCmdmap(string $command, string $table, $id, $value, bool $commandIsProcessed, DataHandler $dataHandler, $pasteUpdate)
Definition: HookFixture.php:109
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\Fixtures\HookFixture\processDatamap_afterAllOperations
‪processDatamap_afterAllOperations(DataHandler $dataHandler)
Definition: HookFixture.php:78