Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • 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.
25 changes: 25 additions & 0 deletions test/core/PrimitiveStringTest.class.php
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));
}
}
?>

0 comments on commit c599248

Please sign in to comment.