Skip to content

Instantly share code, notes, and snippets.

@ciaranmcnulty
Created September 7, 2015 07:31
Show Gist options
  • Save ciaranmcnulty/63d9820feb05f98f3786 to your computer and use it in GitHub Desktop.
Save ciaranmcnulty/63d9820feb05f98f3786 to your computer and use it in GitHub Desktop.
<?php
class NamedSpec extends ObjectBehavior
{
function it_exposes_the_name_it_is_constructed_with()
{
$this->beConstructedNamed('Foo');
$this->getName()->shouldReturn('Foo');
}
function it_cannot_be_constructed_with_an_empty_name()
{
$this->beConstructedNamed('');
$this->shouldThrow(\InvalidArgumentException::class)->duringInstantiation();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment