setFormatter() public méthode

Set theformatter instance to use for the getBrowser() result
public setFormatter ( BrowscapPHP\Formatter\FormatterInterface $formatter ) : Browscap
$formatter BrowscapPHP\Formatter\FormatterInterface
Résultat Browscap
 /**
  *
  */
 public function testGetBrowserWithDefaultResult()
 {
     $formatter = $this->getMock('\\BrowscapPHP\\Formatter\\PhpGetBrowser', array('getData'), array(), '', false);
     $formatter->expects(self::once())->method('getData')->will(self::returnValue(null));
     $parser = $this->getMock('\\BrowscapPHP\\Parser\\Ini', array('getBrowser'), array(), '', false);
     $parser->expects(self::once())->method('getBrowser')->will(self::returnValue(null));
     $this->object->setFormatter($formatter);
     $this->object->setParser($parser);
     $result = $this->object->getBrowser('Mozilla/5.0 (compatible; Ask Jeeves/Teoma)');
     self::assertNull($result);
 }
 /**
  *
  */
 public function testGetBrowserWithDefaultResult()
 {
     $formatter = $this->getMockBuilder(\BrowscapPHP\Formatter\PhpGetBrowser::class)->disableOriginalConstructor()->setMethods(['getData'])->getMock();
     $formatter->expects(self::once())->method('getData')->will(self::returnValue(null));
     $parser = $this->getMockBuilder(\BrowscapPHP\Parser\Ini::class)->disableOriginalConstructor()->setMethods(['getBrowser'])->getMock();
     $parser->expects(self::once())->method('getBrowser')->will(self::returnValue(null));
     $cache = $this->getMockBuilder(\BrowscapPHP\Cache\BrowscapCache::class)->disableOriginalConstructor()->setMethods(['getVersion'])->getMock();
     $cache->expects(self::once())->method('getVersion')->will(self::returnValue(1));
     $this->object->setFormatter($formatter);
     $this->object->setParser($parser);
     $this->object->setCache($cache);
     $result = $this->object->getBrowser('Mozilla/5.0 (compatible; Ask Jeeves/Teoma)');
     self::assertNull($result);
 }