The $component->getPath() uses the logged in user’s data. But I do not know how I can load in the user.

I’ve tried to use the LoginFrom as you can see in the commented lines in setUp() method.

But those loginForm do not work, it gives this error always:

tests\codeception\frontend\unit\components\AccountImageComponentTest::testGetPath
TypeError: Argument 1 passed to PHPUnit_Framework_TestCase::onNotSuccessfulTest() must be an instance of Exception, instance of Error given, called in /home/******/.composer/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 851