コード例 #1
0
ファイル: UnionTypeTest.php プロジェクト: sekjun9878/juggler
 public function testTypeOfScalar()
 {
     $type = new StringType();
     $x = new UnionType(new StringType(), new IntType());
     $this->assertFalse($type->typeof($x));
     $this->assertFalse($x->typeof($type));
 }
コード例 #2
0
ファイル: StringTypeTest.php プロジェクト: sekjun9878/juggler
 public function testJuggleUnion()
 {
     $x = new StringType();
     $this->assertInstanceOf(FloatType::class, $x->juggle(new UnionType(new FloatType(), new ArrayType())));
 }