OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / include / lib / Net_UserAgent_Mobile-1.0.0 / tests / Mobile / NonMobileTestCase.php
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3
4 /**
5  * PHP versions 5
6  *
7  * Copyright (c) 2008-2009 KUBO Atsuhiro <kubo@iteman.jp>,
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  *
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.
18  *
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.
30  *
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
38  */
39
40 require_once dirname(__FILE__) . '/AbstractTestCase.php';
41 require_once 'Net/UserAgent/Mobile/NonMobile.php';
42
43 // {{{ Net_UserAgent_Mobile_NonMobileTestCase
44
45 /**
46  * Some tests for Net_UserAgent_Mobile_NonMobile.
47  *
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
55  */
56 class Net_UserAgent_Mobile_NonMobileTestCase extends Net_UserAgent_Mobile_AbstractTestCase
57 {
58
59     // {{{ properties
60
61     /**#@+
62      * @access public
63      */
64
65     /**#@-*/
66
67     /**#@+
68      * @access protected
69      */
70
71     /**#@-*/
72
73     /**#@+
74      * @access private
75      */
76
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()
79                                );
80
81     /**#@-*/
82
83     /**#@+
84      * @access public
85      */
86
87     public function testShouldDetectUserAgentsAsNonmobile()
88     {
89         reset($this->_profiles);
90         while (list($userAgent, $profile) = each($this->_profiles)) {
91             $agent = new Net_UserAgent_Mobile_NonMobile($userAgent);
92
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());
98         }
99     }
100
101     /**#@-*/
102
103     /**#@+
104      * @access protected
105      */
106
107     /**#@-*/
108
109     /**#@+
110      * @access private
111      */
112
113     /**#@-*/
114
115     // }}}
116 }
117
118 // }}}
119
120 /*
121  * Local Variables:
122  * mode: php
123  * coding: iso-8859-1
124  * tab-width: 4
125  * c-basic-offset: 4
126  * c-hanging-comment-ender-p: nil
127  * indent-tabs-mode: nil
128  * End:
129  */