Skip to content

Commit

Permalink
Merge pull request #34 from dikastes/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dikastes authored Sep 6, 2024
2 parents d6cfcaa + fe23ff0 commit d45b7c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 70 deletions.
4 changes: 2 additions & 2 deletions Tests/Functional/Domain/Model/Fixtures/empty_works.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"tx_dmnorm_domain_model_gndwork"
,"uid","alt_instrumentation"
,1,""
,"uid"
,1
77 changes: 9 additions & 68 deletions Tests/Functional/Domain/Model/PublishedItemComposerNameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -103,46 +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
);
$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
Expand Down

0 comments on commit d45b7c2

Please sign in to comment.