Nimut / testing-framework

TYPO3 testing framework that provides base classes and configuration for PHPUnit tests
GNU General Public License v2.0
52 stars 25 forks source link

Typoscript from setup.ts is not accessible #30

Open robert197 opened 7 years ago

robert197 commented 7 years ago

Hey, It would be very useful to have an access to typoscript defined in setup.ts / setup.txt. I've tried to get an object with this settings or even mock it but didn't find a way to make it possible. Can you support this important feature or maybe give a sign how to make it happen?

robert197 commented 7 years ago

We were able to fix this problem with another library called "Mockery"

 $settingsProviderMock = Mockery::mock(
            'overload:' . \anyNameSpace\anyNamespace\Settings\SettingsProvider::class
        )->makePartial();
        $settingsProviderMock->shouldReceive('fileStorage')->once()->andReturn(2);
IchHabRecht commented 7 years ago

Hi Robert,

I'm not quite sure what the actual problem is/was but did you have a look at mocks and/or prophecies in PHPUnit (https://phpunit.de/manual/current/en/test-doubles.html).