Skip to content

Commit 82a7266

Browse files
committed
Add tests to prove that nullable reference or shasum in Dist will cause the object hydration to fail
1 parent 233caf6 commit 82a7266

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

spec/Packagist/Api/Result/Package/DistSpec.php

+24
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,28 @@ public function it_gets_shasum()
4343
{
4444
$this->getShasum()->shouldReturn('cb0a489db41707d5df078f1f35e028e04ffd9e8e');
4545
}
46+
47+
public function it_can_deal_with_nullable_reference()
48+
{
49+
$this->fromArray([
50+
'type' => 'git',
51+
'url' => 'https://github.com/Sylius/Sylius.git',
52+
'reference' => null,
53+
'shasum' => 'cb0a489db41707d5df078f1f35e028e04ffd9e8e',
54+
]);
55+
56+
$this->getReference()->shouldReturn(null);
57+
}
58+
59+
public function it_can_deal_with_nullable_shasum()
60+
{
61+
$this->fromArray([
62+
'type' => 'git',
63+
'url' => 'https://github.com/Sylius/Sylius.git',
64+
'reference' => 'cb0a489db41707d5df078f1f35e028e04ffd9e8e',
65+
'shasum' => null,
66+
]);
67+
68+
$this->getShasum()->shouldReturn(null);
69+
}
4670
}

0 commit comments

Comments
 (0)