‪TYPO3CMS  ‪main
RecordHistoryTest.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 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
23 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
24 
25 final class ‪RecordHistoryTest extends FunctionalTestCase
26 {
28 
32  protected function ‪setUp(): void
33  {
34  parent::setUp();
35  $this->importCSVDataSet(__DIR__ . '/../Fixtures/sys_history.csv');
36  $this->subject = new ‪RecordHistory();
37  }
38 
40  {
41  return [
42  'da625644-8e50-47ee-8c11-bb19552a79e4' => ['da625644-8e50-47ee-8c11-bb19552a79e4', 2],
43  '3479dc73-7bc8-4d3b-a8bc-0370a68cedd2' => ['3479dc73-7bc8-4d3b-a8bc-0370a68cedd2', 1],
44  ];
45  }
46 
47  #[DataProvider('findEventsForCorrelationWorksAsExpectedDataProvider')]
48  #[Test]
49  public function ‪findEventsForCorrelationWorksAsExpected(string $correlationId, int $amountOfEntries): void
50  {
51  self::assertCount($amountOfEntries, $this->subject->findEventsForCorrelation($correlationId));
52  }
53 }
‪TYPO3\CMS\Backend\Tests\Functional\History\RecordHistoryTest\setUp
‪setUp()
Definition: RecordHistoryTest.php:32
‪TYPO3\CMS\Backend\Tests\Functional\History\RecordHistoryTest\$subject
‪RecordHistory $subject
Definition: RecordHistoryTest.php:27
‪TYPO3\CMS\Backend\Tests\Functional\History
Definition: RecordHistoryStoreTest.php:18
‪TYPO3\CMS\Backend\Tests\Functional\History\RecordHistoryTest\findEventsForCorrelationWorksAsExpectedDataProvider
‪static findEventsForCorrelationWorksAsExpectedDataProvider()
Definition: RecordHistoryTest.php:39
‪TYPO3\CMS\Backend\Tests\Functional\History\RecordHistoryTest
Definition: RecordHistoryTest.php:26
‪TYPO3\CMS\Backend\History\RecordHistory
Definition: RecordHistory.php:32
‪TYPO3\CMS\Backend\Tests\Functional\History\RecordHistoryTest\findEventsForCorrelationWorksAsExpected
‪findEventsForCorrelationWorksAsExpected(string $correlationId, int $amountOfEntries)
Definition: RecordHistoryTest.php:49