number = '123456789'; // This is required because by default a NullAccount without an ID is created in the Profile model // but NullModels without ids are handled like "null" values which are not allowed for Accounts. $profile = ProfileMapper::getFor(1, 'account'); $profile = $profile instanceof NullProfile ? new Profile() : $profile; if ($profile->account->getId() === 0) { $profile->account = new NullAccount(1); } $client->profile = $profile; $id = ClientMapper::create($client); self::assertGreaterThan(0, $client->getId()); self::assertEquals($id, $client->getId()); } /** * @group volume * @group module * @coversNothing */ public function testClientVolume() : void { $profile = ProfileMapper::getFor(1, 'account'); $profile = $profile instanceof NullProfile ? new Profile() : $profile; if ($profile->account->getId() === 0) { $profile->account = new NullAccount(1); } for ($i = 0; $i < 100; ++$i) { $client = new Client(); $client->number = (string) \mt_rand(100000, 999999); $client->profile = $profile; ClientMapper::create($client); } } }