public function testBrowserGetters() { $this->_fakeMozillaFirefox(); $this->assertSame('Firefox', X\THETOOLS::get_browser()); $this->assertSame('17.2', X\THETOOLS::get_browserVersion()); $this->assertSame('Gecko', X\THETOOLS::get_layoutEngine()); }
/** * Checks if \Xiphe\THETOOLS exists and appends browser classes. * * @param string $before separator. * * @return string */ public function browserClass($before = '') { if (class_exists('Xiphe\\THEMASTER\\core\\THEMASTER')) { $browser = str_replace(' ', '_', strtolower(\Xiphe\THETOOLS::get_browser())); $version = str_replace('.', '-', \Xiphe\THETOOLS::get_browserVersion()); $engine = strtolower(\Xiphe\THETOOLS::get_layoutEngine()); if (!empty($engine)) { $engine .= ' '; } if (\Xiphe\THETOOLS::is_browser('mobile')) { $mobile = 'mobile no-desktop'; } else { $mobile = 'desktop no-mobile'; } return "{$before}{$engine}{$browser} {$browser}-{$version} {$mobile}"; } return ''; }