- 
                Notifications
    
You must be signed in to change notification settings  - Fork 44
 
[MAINTENANCE] Add tests for Controller package #954
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
base: 6.x
Are you sure you want to change the base?
Conversation
f31a8fb    to
    eb756a2      
    Compare
  
    8ef040a    to
    2f9eb29      
    Compare
  
    Co-authored-by: Sebastian Meyer <[email protected]>
| foreach ($databaseFixtures as $filePath) { | ||
| $this->importCSVDataSet($filePath); | ||
| } | ||
| $this->persistenceManager = $this->objectManager->get(PersistenceManager::class); | 
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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...
| 
           More tests would be really useful. Therefore I appreciate this pull request. @oliver-stoehr, are you still working on it? I suggest to squash some of the commits (each commit should be complete and produce a working software). A rebase on main would be helpful, too.  | 
    
| 
           Tests created for: 
 In the StatisticsController in the MainAction, the test has so far failed because there was an error in the action. The remaining tests have otherwise passed. However, the problem now is that the new Typo3 version has changed the handling of the response objects. The interface   | 
    
| 
           Successor: #1708  | 
    
Tests for CalendarController will be added in a separate pull request.Update: Added tests for CalendarController in another commit.