Skip to content

Instantly share code, notes, and snippets.

@ibrasho
Last active August 29, 2015 14:06
Show Gist options
  • Save ibrasho/0e7bdda2cd671a4dc2a2 to your computer and use it in GitHub Desktop.
Save ibrasho/0e7bdda2cd671a4dc2a2 to your computer and use it in GitHub Desktop.
<?php
class SomethingSpec extends ObjectBehavior
{
function it_contains_an_instance_of(Class $object)
{
$this->getArray()->shouldContainAnInstanceOf($object);
}
public function getMatchers()
{
return [
'containAnInstanceOf' => function($subject, $instance) {
return is_array($subject) && false !== array_walk($instance, $subject);
}
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment