From 0ec79290a1db356f0c35d6f940b8894a22a256f3 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Fri, 6 Sep 2024 16:54:25 +0200 Subject: [PATCH 1/3] Fix --- Tests/Functional/Domain/Model/Fixtures/empty_works.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Functional/Domain/Model/Fixtures/empty_works.csv b/Tests/Functional/Domain/Model/Fixtures/empty_works.csv index 41126ed..3c93884 100644 --- a/Tests/Functional/Domain/Model/Fixtures/empty_works.csv +++ b/Tests/Functional/Domain/Model/Fixtures/empty_works.csv @@ -1,3 +1,3 @@ "tx_dmnorm_domain_model_gndwork" -,"uid","alt_instrumentation" -,1,"" +,"uid" +,1 From dafcd7972d350f24b350eb9ff8a47263e64b879b Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Fri, 6 Sep 2024 17:30:31 +0200 Subject: [PATCH 2/3] Test --- Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php b/Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php index d2cd9f5..09ea438 100644 --- a/Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php +++ b/Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php @@ -135,6 +135,7 @@ protected function setUp(): void $instrumentRepository, $genreRepository ); + var_dump($this->work1); $this->composer1 = $this->work1->getFirstComposer(); $this->composer2 = $this->work2->getFirstComposer(); From 2bd016bce551cd0d5c63a02cfb4855486f7e3a3f Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Fri, 6 Sep 2024 18:29:21 +0200 Subject: [PATCH 3/3] 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