示例#1
0
 public function testPHPQuery()
 {
     $test = X\THETOOLS::pq('<div id="foo">bar</div>');
     $this->assertSame('phpQueryObject', get_class($test));
     $this->assertSame('<div id="foo">bar</div>', $test->htmlOuter());
 }
示例#2
0
 private function _fakeIPhone()
 {
     X\THETOOLS::unset_browserObj();
     $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A498b Safari/419.3';
 }
示例#3
0
 /**
  * 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 '';
 }
示例#4
0
 public function testFilterGetDataBy()
 {
     $_GET = array('foo_bar' => 'http://google.de/', 'bar' => 'asd');
     $this->assertSame(array('bar' => 'http://google.de/'), X\THETOOLS::filter_getDataBy('foo', array('bar' => 'u')));
 }
示例#5
0
 public function testNormalisation1()
 {
     $this->assertSame('http://example.org/?test', X\THETOOLS::normalizeUrl('http://example.org?test'));
 }