lodestoneLinkController = new LodestoneLinkController( new CodeGeneratorService(), new LodestoneCacheService(), new LodestoneApiService() ); } public function testGetLinkCodeByDiscordAndId() { LinkCode::where('lodestoneId', $this->lodestoneId)->delete(); $response = $this->lodestoneLinkController->checkDiscordId($this->lodestoneId, $this->discordGuildId, $this->discordUserId); $this->assertDatabaseHas('link_codes', [ 'lodestoneId' => $this->lodestoneId, 'code' => $response['linkCode'] ]); } public function testGetLinkCodeByDiscordAndName() { LinkCode::where('lodestoneId', $this->lodestoneId)->delete(); $response = $this->lodestoneLinkController->checkDiscordName($this->server, $this->name, $this->discordGuildId, $this->discordUserId); $this->assertDatabaseHas('link_codes', [ 'lodestoneId' => $this->lodestoneId, 'code' => $response['linkCode'] ]); } public function testGetLinkCodeByWebsiteAndId() { LinkCode::where('lodestoneId', $this->lodestoneId)->delete(); $response = $this->lodestoneLinkController->checkWebsiteId($this->lodestoneId, $this->websiteName, $this->websiteId); $this->assertDatabaseHas('link_codes', [ 'lodestoneId' => $this->lodestoneId, 'code' => $response['linkCode'] ]); } public function testGetLinkCodeByWebsiteAndName() { LinkCode::where('lodestoneId', $this->lodestoneId)->delete(); $response = $this->lodestoneLinkController->checkWebsiteName($this->server, $this->name, $this->websiteName, $this->websiteId); $this->assertDatabaseHas('link_codes', [ 'lodestoneId' => $this->lodestoneId, 'code' => $response['linkCode'] ]); } }