示例#1
0
 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
 public function testJuggleUnion()
 {
     $x = new StringType();
     $this->assertInstanceOf(FloatType::class, $x->juggle(new UnionType(new FloatType(), new ArrayType())));
 }