|
|
@@ -55,6 +55,9 @@ class IntegerTypeTest extends TestCase
|
|
|
$result = $this->type->toPHP('2 bears', $this->driver);
|
|
|
$this->assertSame(2, $result);
|
|
|
|
|
|
+ $result = $this->type->toPHP('-2', $this->driver);
|
|
|
+ $this->assertSame(-2, $result);
|
|
|
+
|
|
|
$result = $this->type->toPHP(['3', '4'], $this->driver);
|
|
|
$this->assertSame(1, $result);
|
|
|
}
|
|
|
@@ -95,7 +98,7 @@ class IntegerTypeTest extends TestCase
|
|
|
public function testMarshal()
|
|
|
{
|
|
|
$result = $this->type->marshal('some data', $this->driver);
|
|
|
- $this->assertSame('some data', $result);
|
|
|
+ $this->assertNull($result);
|
|
|
|
|
|
$result = $this->type->marshal('', $this->driver);
|
|
|
$this->assertNull($result);
|
|
|
@@ -109,11 +112,17 @@ class IntegerTypeTest extends TestCase
|
|
|
$result = $this->type->marshal(105, $this->driver);
|
|
|
$this->assertSame(105, $result);
|
|
|
|
|
|
+ $result = $this->type->marshal('-105', $this->driver);
|
|
|
+ $this->assertSame(-105, $result);
|
|
|
+
|
|
|
+ $result = $this->type->marshal(-105, $this->driver);
|
|
|
+ $this->assertSame(-105, $result);
|
|
|
+
|
|
|
$result = $this->type->marshal('1.25', $this->driver);
|
|
|
- $this->assertSame('1.25', $result);
|
|
|
+ $this->assertSame(1, $result);
|
|
|
|
|
|
$result = $this->type->marshal('2 monkeys', $this->driver);
|
|
|
- $this->assertSame('2 monkeys', $result);
|
|
|
+ $this->assertNull($result);
|
|
|
|
|
|
$result = $this->type->marshal(['3', '4'], $this->driver);
|
|
|
$this->assertSame(1, $result);
|