1<?php
2/* vim: set expandtab tabstop=4 shiftwidth=4: */
3
4/**
5 * PHP versions 5
6 *
7 * LICENSE: This source file is subject to version 3.0 of the PHP license
8 * that is available through the world-wide-web at the following URI:
9 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
10 * the PHP License and are unable to obtain it through the web, please
11 * send a note to license@php.net so we can mail you a copy immediately.
12 *
13 * @category   Networking
14 * @package    Net_UserAgent_Mobile
15 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net>
16 * @copyright  2008 KUBO Atsuhiro <iteman@users.sourceforge.net>
17 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
18 * @version    CVS: $Id: NonMobileTestCase.php,v 1.1 2008/02/06 03:24:33 kuboa Exp $
19 * @since      File available since Release 0.31.0
20 */
21
22require_once 'PHPUnit/Framework/TestCase.php';
23require_once 'Net/UserAgent/Mobile/NonMobile.php';
24
25// {{{ Net_UserAgent_Mobile_NonMobileTestCase
26
27/**
28 * Some tests for Net_UserAgent_Mobile_NonMobile.
29 *
30 * @category   Networking
31 * @package    Net_UserAgent_Mobile
32 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net>
33 * @copyright  2008 KUBO Atsuhiro <iteman@users.sourceforge.net>
34 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
35 * @version    Release: 1.0.0RC1
36 * @since      Class available since Release 0.31.0
37 */
38class Net_UserAgent_Mobile_NonMobileTestCase extends PHPUnit_Framework_TestCase
39{
40
41    // {{{ properties
42
43    /**#@+
44     * @access public
45     */
46
47    /**#@-*/
48
49    /**#@+
50     * @access protected
51     */
52
53    /**#@-*/
54
55    /**#@+
56     * @access private
57     */
58
59    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(),
60                               'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)' => array()
61                               );
62
63    /**#@-*/
64
65    /**#@+
66     * @access public
67     */
68
69    public function testShouldDetectUserAgentsAsNonmobile()
70    {
71        reset($this->_profiles);
72        while (list($userAgent, $profile) = each($this->_profiles)) {
73            $agent = new Net_UserAgent_Mobile_NonMobile($userAgent);
74
75            $this->assertFalse($agent->isDoCoMo());
76            $this->assertFalse($agent->isEZweb());
77            $this->assertFalse($agent->isSoftBank());
78            $this->assertFalse($agent->isWillcom());
79            $this->assertTrue($agent->isNonMobile());
80        }
81    }
82
83    /**#@-*/
84
85    /**#@+
86     * @access protected
87     */
88
89    /**#@-*/
90
91    /**#@+
92     * @access private
93     */
94
95    /**#@-*/
96
97    // }}}
98}
99
100// }}}
101
102/*
103 * Local Variables:
104 * mode: php
105 * coding: iso-8859-1
106 * tab-width: 4
107 * c-basic-offset: 4
108 * c-hanging-comment-ender-p: nil
109 * indent-tabs-mode: nil
110 * End:
111 */
112