Skip to content

Commit

Permalink
testOriginalSyntaxMustBeAString
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotchance committed Sep 22, 2014
1 parent 34efa92 commit 95a8281
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Concise/Assertion.php
Expand Up @@ -61,6 +61,8 @@ public function __construct($assertionString, Matcher\AbstractMatcher $matcher,
*/
public function setOriginalSyntax($originalSyntax)
{
ArgumentChecker::check($originalSyntax, 'string');

$this->originalSyntax = $originalSyntax;
}

Expand Down
10 changes: 10 additions & 0 deletions tests/Concise/AssertionTest.php
Expand Up @@ -124,4 +124,14 @@ public function testAssertionMustBeAString()
{
new Assertion(123, new True());
}

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Expected string, but got integer for argument 1
*/
public function testOriginalSyntaxMustBeAString()
{
$assertion = new Assertion('true', new True());
$assertion->setOriginalSyntax(123);
}
}

0 comments on commit 95a8281

Please sign in to comment.