forked from onPHP/onphp-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander A. Zaytsev
committed
Sep 16, 2011
1 parent
a81fdfa
commit c599248
Showing
1 changed file
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
final class PrimitiveStringTest extends TestCase | ||
{ | ||
public function testImport() | ||
{ | ||
$prm = Primitive::string('name'); | ||
|
||
$nullValues = array(null, ''); | ||
|
||
foreach ($nullValues as $value) | ||
$this->assertNull($prm->importValue($value)); | ||
|
||
$falseValues = array(array(), true, false, $prm); | ||
|
||
foreach ($falseValues as $value) | ||
$this->assertFalse($prm->importValue($value)); | ||
|
||
$trueValues = array('some string', -100500, 2011.09); | ||
|
||
foreach ($trueValues as $value) | ||
$this->assertTrue($prm->importValue($value)); | ||
} | ||
} | ||
?> |