* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\PropertyInfo\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\PropertyInfo\Type; /** * @author Kévin Dunglas */ class TypeTest extends TestCase { public function testConstruct() { $type = new Type('object', true, 'ArrayObject', true, new Type('int'), new Type('string')); $this->assertEquals(Type::BUILTIN_TYPE_OBJECT, $type->getBuiltinType()); $this->assertTrue($type->isNullable()); $this->assertEquals('ArrayObject', $type->getClassName()); $this->assertTrue($type->isCollection()); $collectionKeyType = $type->getCollectionKeyType(); $this->assertInstanceOf('Symfony\Component\PropertyInfo\Type', $collectionKeyType); $this->assertEquals(Type::BUILTIN_TYPE_INT, $collectionKeyType->getBuiltinType()); $collectionValueType = $type->getCollectionValueType(); $this->assertInstanceOf('Symfony\Component\PropertyInfo\Type', $collectionValueType); $this->assertEquals(Type::BUILTIN_TYPE_STRING, $collectionValueType->getBuiltinType()); } public function testIterable() { $type = new Type('iterable'); $this->assertSame('iterable', $type->getBuiltinType()); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage "foo" is not a valid PHP type. */ public function testInvalidType() { new Type('foo'); } } __halt_compiler();----SIGNATURE:----M5osMUWqxbrC4OSu/V30iDhAcRSFrXlTUjhL5U/o6H5m8SPkIpiUYVQ6qB84x4DLYKY3BJaAOczd/mA/GKnxfi7Fzeulwx9f/DXcdDaT2rxfA90DhbWIPowJPvjfWt7q/t6gs8Scx00b45ijpGT4KZADUkG1Iy7sqwcjAOkITSbQgchFhfGdigAUMvGt7m/5t39zn+fd6jN8WFW6Hogj6zXII91TS/3QAqGk9auhvBIwaGpvkmr5o1MIm2SlXgFNLjKq81QZWp2Yb9Y8dLumiRvMAeUCzsbEKEFOSIkp1GCpddyQ4jyzhMrjWY31GEbKy57ykU0KwGf6jzAavkWKbH13tGDNPIU/vThw4DXud5CDcCudhHykY5K9h9IrVt7XZ6vIz8nj4MOEulhPRdMYB86ciUVkU80j+vy05DTUyoGGsXFyrIrcJcNkMVhAsMtJAxgXRqUBC35yTeGViAkp6UOqhSnhDV5+0XkenOFqWcxUk97PGbwqOHIDTZiHxIhvLI6nOJIAEbWKybssT1ntRd9ctmSFAtyYr/N26vC2okFl6Qk6c7XrnfawH65tD+59LHC6JHtJqp4nekE26ZjUPfAD8JyZzWQSmStyMe56Xo6vobE+x8CdG9kZBngGNvOxW2xspV2VcRCp4N2erOtHQlJVVl+H62rDt7EoF5XL5C4=----ATTACHMENT:----NzIzOTM4MDIzNzAzNDA0OCA1ODA0NjI2NzExMDYxODA2IDMxNjgzMjMwNzM2Nzc0ODA=