We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e354cd commit 96195deCopy full SHA for 96195de
src/Pixel/Pixel.php
@@ -21,7 +21,7 @@ final class Pixel
21
public function __construct(string $id, string $accessToken = null)
22
{
23
$this->id = $id;
24
- $this->accessToken = $accessToken;
+ $this->accessToken = '' === $accessToken ? null : $accessToken;
25
}
26
27
public function __toString(): string
tests/Pixel/PixelTest.php
@@ -28,4 +28,13 @@ public function it_is_stringable(): void
28
$pixel = new Pixel('id');
29
self::assertSame('id', (string) $pixel);
30
31
+
32
+ /**
33
+ * @test
34
+ */
35
+ public function it_converts_empty_string_access_token_to_null(): void
36
+ {
37
+ $pixel = new Pixel('id', '');
38
+ self::assertNull($pixel->accessToken);
39
+ }
40
0 commit comments