. */ namespace SP\Tests\Domain\Account\Services; use Defuse\Crypto\Exception\EnvironmentIsBrokenException; use PHPUnit\Framework\Attributes\Group; use SP\Domain\Account\Dtos\PublicLinkKey; use SP\Tests\UnitaryTestCase; /** * Class PublicLinkKeyTest * */ #[Group('unitary')] class PublicLinkKeyTest extends UnitaryTestCase { /** * @throws EnvironmentIsBrokenException */ public function testGetKeyWithoutHash() { $publicLinkKey = new PublicLinkKey(self::$faker->sha1); $this->assertNotEmpty($publicLinkKey->getKey()); $this->assertNotEmpty($publicLinkKey->getHash()); } /** * @throws EnvironmentIsBrokenException */ public function testGetKeyWithHash() { $hash = self::$faker->sha1; $publicLinkKey = new PublicLinkKey(self::$faker->sha1, $hash); $this->assertNotEmpty($publicLinkKey->getKey()); $this->assertEquals($hash, $publicLinkKey->getHash()); } }