2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
7 * Copyright (c) 2008-2009 KUBO Atsuhiro <kubo@iteman.jp>,
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
31 * @category Networking
32 * @package Net_UserAgent_Mobile
33 * @author KUBO Atsuhiro <kubo@iteman.jp>
34 * @copyright 2008-2009 KUBO Atsuhiro <kubo@iteman.jp>
35 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
36 * @version CVS: $Id: NonMobileTestCase.php 2036 2009-07-03 04:52:56Z fishbone $
37 * @since File available since Release 0.31.0
40 require_once dirname(__FILE__) . '/AbstractTestCase.php';
41 require_once 'Net/UserAgent/Mobile/NonMobile.php';
43 // {{{ Net_UserAgent_Mobile_NonMobileTestCase
46 * Some tests for Net_UserAgent_Mobile_NonMobile.
48 * @category Networking
49 * @package Net_UserAgent_Mobile
50 * @author KUBO Atsuhiro <kubo@iteman.jp>
51 * @copyright 2008-2009 KUBO Atsuhiro <kubo@iteman.jp>
52 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
53 * @version Release: 1.0.0
54 * @since Class available since Release 0.31.0
56 class Net_UserAgent_Mobile_NonMobileTestCase extends Net_UserAgent_Mobile_AbstractTestCase
77 private $_profiles = array('Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 GoogleToolbarFF 3.0.20070525' => array(),
78 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)' => array()
87 public function testShouldDetectUserAgentsAsNonmobile()
89 reset($this->_profiles);
90 while (list($userAgent, $profile) = each($this->_profiles)) {
91 $agent = new Net_UserAgent_Mobile_NonMobile($userAgent);
93 $this->assertFalse($agent->isDoCoMo());
94 $this->assertFalse($agent->isEZweb());
95 $this->assertFalse($agent->isSoftBank());
96 $this->assertFalse($agent->isWillcom());
97 $this->assertTrue($agent->isNonMobile());
126 * c-hanging-comment-ender-p: nil
127 * indent-tabs-mode: nil