PhpOffice\PhpPresentation\Tests\Shape\GroupTest::testExtentsAndOffsetsForTwoShapes PHP Method

testExtentsAndOffsetsForTwoShapes() public method

    public function testExtentsAndOffsetsForTwoShapes()
    {
        // Since Groups and Slides cache offsets and extents on first
        // calculation, this test is separate from the above.
        // Should the calculation be performed every GET, this test can be
        // combined with the above.
        $offsetX = 100;
        $offsetY = 100;
        $extentX = 1000;
        $extentY = 450;
        $increase = 50;
        $line1 = new Line($offsetX, $offsetY, $extentX, $extentY);
        $line2 = new Line($offsetX + $increase, $offsetY + $increase, $extentX + $increase, $extentY + $increase);
        $object = new Group();
        $object->addShape($line1);
        $object->addShape($line2);
        $this->assertEquals($offsetX, $object->getOffsetX());
        $this->assertEquals($offsetY, $object->getOffsetY());
        $this->assertEquals($extentX + $increase, $object->getExtentX());
        $this->assertEquals($extentY + $increase, $object->getExtentY());
    }