testing-framework icon indicating copy to clipboard operation
testing-framework copied to clipboard

Typoscript from setup.ts is not accessible

Open robert197 opened this issue 7 years ago • 2 comments

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 avatar Jun 14 '17 16:06 robert197

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);

robert197 avatar Jun 15 '17 13:06 robert197

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).

IchHabRecht avatar Jun 22 '17 11:06 IchHabRecht