This repository has been archived by the owner on May 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve type: number validation (#69)
- Loading branch information
Matt A
committed
Nov 18, 2016
1 parent
1ff119c
commit 7863d0b
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace League\JsonGuard\Test\Constraints; | ||
|
||
use League\JsonGuard\Constraints\Type; | ||
use League\JsonGuard\ValidationError; | ||
|
||
class TypeTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testNumericStringIsNotANumber() | ||
{ | ||
$type = new Type(); | ||
|
||
$error = $type->validate('1', 'number'); | ||
|
||
$this->assertInstanceOf(ValidationError::class, $error); | ||
} | ||
} |