renderAllDivisionsHeader() 공개 메소드

renders the header for all divisions
public renderAllDivisionsHeader ( DataCollection $collection ) : Browscap\Writer\WriterInterface
$collection Browscap\Data\DataCollection
리턴 Browscap\Writer\WriterInterface
예제 #1
0
 /**
  * tests rendering the header for all division
  *
  * @group writer
  * @group sourcetest
  */
 public function testRenderAllDivisionsHeaderWithoutProperties()
 {
     $division = $this->getMockBuilder(\Browscap\Data\Division::class)->disableOriginalConstructor()->setMethods(['getUserAgents'])->getMock();
     $division->expects(self::once())->method('getUserAgents')->will(self::returnValue([]));
     $collection = $this->getMockBuilder(\Browscap\Data\DataCollection::class)->disableOriginalConstructor()->setMethods(['getDefaultProperties'])->getMock();
     $collection->expects(self::once())->method('getDefaultProperties')->will(self::returnValue($division));
     self::assertSame($this->object, $this->object->renderAllDivisionsHeader($collection));
     self::assertSame('', file_get_contents($this->file));
 }
예제 #2
0
 /**
  * tests rendering the header for all division
  *
  * @group writer
  * @group sourcetest
  */
 public function testRenderAllDivisionsHeaderWithoutProperties()
 {
     $mockDivision = $this->getMock('\\Browscap\\Data\\Division', array('getUserAgents'), array(), '', false);
     $mockDivision->expects(self::once())->method('getUserAgents')->will(self::returnValue(array()));
     $mockCollection = $this->getMock('\\Browscap\\Data\\DataCollection', array('getDefaultProperties'), array(), '', false);
     $mockCollection->expects(self::once())->method('getDefaultProperties')->will(self::returnValue($mockDivision));
     self::assertSame($this->object, $this->object->renderAllDivisionsHeader($mockCollection));
     self::assertSame('', file_get_contents($this->file));
 }