Skip to content

Commit 2e354cd

Browse files
committed
Fix bug in fbc value
1 parent e0fb35a commit 2e354cd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/ValueObject/Fbc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static function fromString(string $value): self
3939

4040
public function value(): string
4141
{
42-
return sprintf('fb.%d.%d.%d', $this->getSubdomainIndex(), $this->getCreationTime(), $this->clickId);
42+
return sprintf('fb.%d.%d.%s', $this->getSubdomainIndex(), $this->getCreationTime(), $this->clickId);
4343
}
4444

4545
/**

tests/ValueObject/FbcTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public function it_has_sane_defaults(): void
2323
*/
2424
public function it_instantiates_from_string(): void
2525
{
26-
$fbc = Fbc::fromString('fb.1.1657051589577.IwAR0rmfgHgxjdKoEopat9y2SPzyjGgfHm9AhdqygToWvarP59nPq15T07MiA');
26+
$str = 'fb.1.1657051589577.IwAR0rmfgHgxjdKoEopat9y2SPzyjGgfHm9AhdqygToWvarP59nPq15T07MiA';
27+
$fbc = Fbc::fromString($str);
2728

2829
$expectedDateTime = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2022-07-05 20:06:29');
2930

@@ -33,6 +34,7 @@ public function it_instantiates_from_string(): void
3334
self::assertSame(1657051589, $fbc->getCreationTimeAsSeconds());
3435
self::assertSame($expectedDateTime->getTimestamp(), $fbc->getCreationTimeAsDateTime()->getTimestamp());
3536
self::assertSame('IwAR0rmfgHgxjdKoEopat9y2SPzyjGgfHm9AhdqygToWvarP59nPq15T07MiA', $fbc->getClickId());
37+
self::assertSame($str, $fbc->value());
3638
}
3739

3840
/**

0 commit comments

Comments
 (0)