From 2bd016bce551cd0d5c63a02cfb4855486f7e3a3f Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Fri, 6 Sep 2024 18:29:21 +0200 Subject: [PATCH] Adjust test for local execution --- .../Model/PublishedItemComposerNameTest.php | 78 +++---------------- 1 file changed, 9 insertions(+), 69 deletions(-) diff --git a/Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php b/Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php index 09ea438..daff8e9 100644 --- a/Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php +++ b/Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php @@ -52,43 +52,15 @@ class PublishedItemComposerNameTest extends FunctionalTestCase */ protected ?GndPerson $composer2 = null; - /** - * @var \Slub\DmNorm\Domain\Model\GndPerson - */ - protected ?GndPerson $composer3 = null; - - /** - * @var string - */ - protected string $nameComposer1 = ''; - - /** - * @var string - */ - protected string $nameComposer2 = ''; - /** * @var string */ - protected string $nameComposer3 = ''; + protected string $nameComposer1 = 'J. S. Bach'; /** - * Musik für Orgel; J. S. Bach * @var string */ - protected string $gndId1 = '300568517'; - - /** - * Gesänge, op. 43; J. Brahms - * @var string - */ - protected string $gndId2 = '107761277X'; - - /** - * Six trio sonatas; J. S. Bach - * @var string - */ - protected string $gndId3 = '300011040'; + protected string $nameComposer2 = 'J. Brahms'; protected array $testExtensionsToLoad = [ 'typo3conf/ext/dm-norm' @@ -103,47 +75,15 @@ protected function setUp(): void $this->work2 = new GndWork(); $this->work3 = new GndWork(); - $this->importCSVDataSet(__DIR__ . '/Fixtures/empty_persons.csv'); - $this->importCSVDataSet(__DIR__ . '/Fixtures/empty_works.csv'); - - $objectManager = GeneralUtility::makeInstance(ObjectManager::class); - $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); - $workRepository = GeneralUtility::makeInstance(GndWorkRepository::class, $objectManager); - $workRepository->injectPersistenceManager($persistenceManager); - $personRepository = GeneralUtility::makeInstance(GndPersonRepository::class, $objectManager); - $personRepository->injectPersistenceManager($persistenceManager); - $instrumentRepository = GeneralUtility::makeInstance(GndInstrumentRepository::class, $objectManager); - $instrumentRepository->injectPersistenceManager($persistenceManager); - $genreRepository = GeneralUtility::makeInstance(GndGenreRepository::class, $objectManager); - $genreRepository->injectPersistenceManager($persistenceManager); - - $this->work1->setGndId($this->gndId1)->pullGndInfo( - $workRepository, - $personRepository, - $instrumentRepository, - $genreRepository - ); - $this->work2->setGndId($this->gndId2)->pullGndInfo( - $workRepository, - $personRepository, - $instrumentRepository, - $genreRepository - ); - $this->work3->setGndId($this->gndId3)->pullGndInfo( - $workRepository, - $personRepository, - $instrumentRepository, - $genreRepository - ); - var_dump($this->work1); + $this->composer1 = new GndPerson(); + $this->composer2 = new GndPerson(); - $this->composer1 = $this->work1->getFirstComposer(); - $this->composer2 = $this->work2->getFirstComposer(); - $this->composer3 = $this->work3->getFirstComposer(); + $this->composer1->setName($this->nameComposer1); + $this->composer2->setName($this->nameComposer2); - $this->nameComposer1 = $this->composer1->getName(); - $this->nameComposer2 = $this->composer2->getName(); - $this->nameComposer3 = $this->composer3->getName(); + $this->work1->setFirstcomposer($this->composer1); + $this->work2->setFirstcomposer($this->composer2); + $this->work3->setFirstcomposer($this->composer1); } protected function tearDown(): void