create(ParserFactory::PREFER_PHP7); } public function testIntOrString() { $this->assertEquals( 'int|string', (string) Type::combineTypes([ Type::parseString('int', false), Type::parseString('string', false) ]) ); } public function testArrayOfIntOrString() { $this->assertEquals( 'array', (string) Type::combineTypes([ Type::parseString('array', false), Type::parseString('array', false) ]) ); } public function testArrayOfIntOrAlsoString() { $this->assertEquals( 'array|string', (string) Type::combineTypes([ Type::parseString('array', false), Type::parseString('string', false) ]) ); } public function testEmptyArrays() { $this->assertEquals( 'array', (string) Type::combineTypes([ Type::parseString('array', false), Type::parseString('array', false) ]) ); } public function testArrayStringOrEmptyArray() { $this->assertEquals( 'array', (string) Type::combineTypes([ Type::parseString('array', false), Type::parseString('array', false) ]) ); } public function testArrayMixedOrString() { $this->assertEquals( 'array', (string) Type::combineTypes([ Type::parseString('array', false), Type::parseString('array', false) ]) ); } public function testArrayMixedOrEmpty() { $this->assertEquals( 'array', (string) Type::combineTypes([ Type::parseString('array', false), Type::parseString('array', false) ]) ); } public function testArrayBigCombination() { $this->assertEquals( 'array', (string) Type::combineTypes([ Type::parseString('array', false), Type::parseString('array', false) ]) ); } public function testFalseDestruction() { $this->assertEquals( 'bool', (string) Type::combineTypes([ Type::parseString('false', false), Type::parseString('bool', false) ]) ); } public function testOnlyFalse() { $this->assertEquals( 'bool', (string) Type::combineTypes([ Type::parseString('false', false) ]) ); } public function testFalseFalseDestruction() { $this->assertEquals( 'bool', (string) Type::combineTypes([ Type::parseString('false', false), Type::parseString('false', false) ]) ); } public function testMultipleValuedArray() { $stmts = self::$_parser->parse('check(); } }