Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINTENANCE] Add tests for Controller package #954

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

oliver-stoehr
Copy link
Contributor

@oliver-stoehr oliver-stoehr commented Apr 28, 2023

Tests for CalendarController will be added in a separate pull request.
Update: Added tests for CalendarController in another commit.

@sebastian-meyer sebastian-meyer changed the title Add tests for Controller package [MAINTENANCE] Add tests for Controller package May 24, 2023
@sebastian-meyer sebastian-meyer self-requested a review May 24, 2023 19:17
@sebastian-meyer sebastian-meyer added 🛠 maintenance A task to keep the code up-to-date and manageable. ⭐ development fund 2022 A candidate for the Kitodo e.V. development fund. labels May 24, 2023
@sebastian-meyer sebastian-meyer linked an issue Feb 1, 2024 that may be closed by this pull request
composer.json Outdated Show resolved Hide resolved
Co-authored-by: Sebastian Meyer <[email protected]>
foreach ($databaseFixtures as $filePath) {
$this->importCSVDataSet($filePath);
}
$this->persistenceManager = $this->objectManager->get(PersistenceManager::class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the problem why the tests fail. $this->objectManager->get() throws the error Call to a member function get() on null, so $this->objectManager isn't initialized.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails because as of version 12 the GeneralUtilityManager is used to get an instance of a class. However, if I change this, all tests fail. The response only contains an empty string. This must be related to the changes to version 12.
$this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this fixed the issue. Now the tests are running for both, v11 and v12. Unfortunately, some of the tests fail...

@sebastian-meyer sebastian-meyer changed the base branch from master to tests-controller October 22, 2024 11:14
@sebastian-meyer sebastian-meyer changed the base branch from tests-controller to master October 22, 2024 11:15
@sebastian-meyer sebastian-meyer marked this pull request as draft October 22, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ development fund 2022 A candidate for the Kitodo e.V. development fund. 🛠 maintenance A task to keep the code up-to-date and manageable.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FUND] Add tests and significantly improve test coverage
4 participants