diff --git a/src/Storageless/Http/Configuration.php b/src/Storageless/Http/Configuration.php index fdc3842b..78388cac 100644 --- a/src/Storageless/Http/Configuration.php +++ b/src/Storageless/Http/Configuration.php @@ -98,7 +98,7 @@ public function getClientFingerprintConfiguration(): FingerprintConfig public function withJwtConfiguration(JwtConfig $jwtConfiguration): self { $new = clone $this; - $new->jwtConfiguration = clone $jwtConfiguration; + $new->jwtConfiguration = $jwtConfiguration; return $new; } @@ -106,7 +106,7 @@ public function withJwtConfiguration(JwtConfig $jwtConfiguration): self public function withClock(Clock $clock): self { $new = clone $this; - $new->clock = clone $clock; + $new->clock = $clock; return $new; } diff --git a/test/StoragelessTest/Http/ConfigurationTest.php b/test/StoragelessTest/Http/ConfigurationTest.php index d9a60d28..2beb6b19 100644 --- a/test/StoragelessTest/Http/ConfigurationTest.php +++ b/test/StoragelessTest/Http/ConfigurationTest.php @@ -94,12 +94,12 @@ public function testImmutability(): void $jwtConfig = clone $this->jwtConfig; $rightConfig = $leftConfig->withJwtConfiguration($jwtConfig); self::assertNotSame($leftConfig, $rightConfig); - self::assertNotSame($jwtConfig, $rightConfig->getJwtConfiguration()); + self::assertSame($jwtConfig, $rightConfig->getJwtConfiguration()); $clock = FrozenClock::fromUTC(); $leftConfig = $rightConfig->withClock($clock); self::assertNotSame($leftConfig, $rightConfig); - self::assertNotSame($clock, $leftConfig->getClock()); + self::assertSame($clock, $leftConfig->getClock()); $cookie = SetCookie::create('foo'); $rightConfig = $leftConfig->withCookie($cookie);