浏览代码

fix tests

euromark 12 年之前
父节点
当前提交
a0820ac363
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 1
      Controller/Component/MobileComponent.php
  2. 2 0
      Test/Case/Controller/Component/MobileComponentTest.php

+ 1 - 1
Controller/Component/MobileComponent.php

@@ -278,7 +278,7 @@ class MobileComponent extends Component {
 	public function detectByVendor($engine) {
 		$isMobile = $this->Session->read('Session.mobile');
 		if ($isMobile !== null) {
-			return $isMobile;
+			return (bool)$isMobile;
 		}
 
 		// Deprecated - the vendor libs are far more accurate and up to date

+ 2 - 0
Test/Case/Controller/Component/MobileComponentTest.php

@@ -25,6 +25,8 @@ class MobileComponentTest extends CakeTestCase {
 
 		CakeSession::delete('User');
 		Configure::delete('User');
+
+		$this->skipIf(php_sapi_name() === 'cli', 'Currently not testable via CLI');
 	}
 
 	/**