public function testGetStartPositionInvisiblePageHeaderThenDetails() { $report = new \RevPDFLib\Report(); $report->setTopMargin(20); $pageheader = $this->getMockBuilder('RevPDFLib\\Items\\Part\\PageHeader')->disableOriginalConstructor()->getMock(); $pageheader->expects($this->any())->method('getStartPosition')->will($this->returnValue(10)); $pageheader->expects($this->any())->method('getIdentifier')->will($this->returnValue(0)); $pageheader->expects($this->any())->method('getHeight')->will($this->returnValue(40)); $pageheader->expects($this->any())->method('isVisible')->will($this->returnValue(false)); $report->addPart('details', $this->object); $report->addPart('pageheader', $pageheader); $this->assertEquals(20, $report->getPart('details')->getStartPosition()); }
public function testGetStartPositionPageHeaderAndReportHeaderAndDetails() { $report = new \RevPDFLib\Report(); $report->setTopMargin(15); $pageheader = $this->getMockBuilder('RevPDFLib\\Items\\Part\\PageHeader')->disableOriginalConstructor()->getMock(); $pageheader->expects($this->any())->method('getStartPosition')->will($this->returnValue(10)); $pageheader->expects($this->any())->method('getIdentifier')->will($this->returnValue(0)); $pageheader->expects($this->any())->method('getHeight')->will($this->returnValue(40)); $pageheader->expects($this->any())->method('isVisible')->will($this->returnValue(true)); $details = $this->getMockBuilder('RevPDFLib\\Items\\Part\\Details')->disableOriginalConstructor()->getMock(); $details->expects($this->any())->method('getStartPosition')->will($this->returnValue(10)); $details->expects($this->any())->method('getIdentifier')->will($this->returnValue(3)); $details->expects($this->any())->method('getHeight')->will($this->returnValue(30)); $details->expects($this->any())->method('isVisible')->will($this->returnValue(true)); $report->addPart('pageheader', $pageheader); $report->addPart('reportheader', $this->part); $report->addPart('details', $details); $this->assertEquals(55, $report->getPart('reportheader')->getStartPosition()); }