Impossible to get/manipulate user folder in PhpUnit tests

I’m writing PhpUnit tests for PhoneTrack and i’ve got problems using Nextcloud’s filesystem. Database manipulation goes well…

I create a user like that :

public function setUp() {
  ...
  $this->container->getServer()->getUserManager()->createUser('userone', 'lalala');
  ...
}

then, in a test method, i try to create a folder :

$userfolder = $this->container->query('ServerContainer')->getUserFolder('userone');
$userfolder->newFolder('/dummy');

and i get OCP\Files\NotFoundException. It seems to me something is missing when creating the user. Do i forget to do something here ?

Ok i found a way to make it work. It could be helpful to someone else.

If user creation is done in static method public static function setUpBeforeClass(), user folder is created correctly and then accessible in test methods.