Pinq\Tests\Integration\Analysis\TypeSystemTest::testCommonAncestorResolution PHP Метод

testCommonAncestorResolution() публичный Метод

    public function testCommonAncestorResolution()
    {
        $mixed = $this->typeSystem->getNativeType(INativeType::TYPE_MIXED);
        $this->assertCommonAncestor($mixed, $this->typeSystem->getNativeType(INativeType::TYPE_MIXED), $this->typeSystem->getNativeType(INativeType::TYPE_STRING));
        $this->assertCommonAncestor($this->typeSystem->getNativeType(INativeType::TYPE_STRING), $this->typeSystem->getNativeType(INativeType::TYPE_STRING), $this->typeSystem->getNativeType(INativeType::TYPE_STRING));
        $this->assertCommonAncestor($mixed, $this->typeSystem->getNativeType(INativeType::TYPE_STRING), $this->typeSystem->getObjectType('stdClass'));
        $this->assertObjectCommonAncestor('stdClass', 'stdClass', 'stdClass');
        $this->assertObjectCommonAncestor(ITraversable::ITRAVERSABLE_TYPE, ICollection::ICOLLECTION_TYPE, ITraversable::ITRAVERSABLE_TYPE);
        $this->assertObjectCommonAncestor('IteratorAggregate', 'IteratorAggregate', IRepository::IREPOSITORY_TYPE);
        $this->assertObjectCommonAncestor(['IteratorAggregate', 'Iterator'], ['IteratorAggregate', 'Iterator', 'Traversable'], IRepository::IREPOSITORY_TYPE);
        $this->assertObjectCommonAncestor('Traversable', 'Traversable', 'ArrayObject');
        $this->assertObjectCommonAncestor(['ArrayAccess', 'Countable', 'Serializable', 'Traversable'], 'ArrayObject', 'ArrayIterator');
        $this->assertObjectCommonAncestor('Iterator', 'SeekableIterator', 'RecursiveIterator');
        $this->assertObjectCommonAncestor('Traversable', 'Iterator', ['IteratorAggregate', 'ArrayObject', 'ArrayObject']);
        $this->assertObjectCommonAncestor('Traversable', 'ArrayObject', 'DatePeriod');
    }