Created
June 10, 2017 17:05
-
-
Save symm/420cbc4ee580d9c1f1121130c2b40bd9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function it_decodes_a_json_export_into_a_collection_of_bookmarks() | |
{ | |
$result = $this->parse(__DIR__ . '/../pinboard_export.json'); | |
$result->shouldHaveType(Collection::class); | |
$result->shouldHaveCount(3); | |
$result->shouldContainOnlyInstancesOf(Bookmark::class); | |
} | |
public function getMatchers() | |
{ | |
return [ | |
'containOnlyInstancesOf' => function($collection, $className) { | |
foreach ($collection as $item) { | |
if (!$item instanceof $className){ | |
return false; | |
} | |
} | |
return true; | |
} | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment