cvs: pear /Net_UserAgent_Mobile/tests 05-display.phpt /Net_UserAgent_Mobile/tests/Mobile DoCoMoTestCase.php EZwebTestCase.php SoftBankTestCase.php
[email protected] ("KUBO Atsuhiro") Sat, 10 May 2008 09:25:13 -0000
| Newsgroups | php.pear.cvs |
|---|---|
| Message-ID | <cvskuboa1210411513@cvsserver> |
kuboa Sat May 10 09:25:13 2008 UTC
Removed files:
/pear/Net_UserAgent_Mobile/tests 05-display.phpt
Modified files:
/pear/Net_UserAgent_Mobile/tests/Mobile DoCoMoTestCase.php
EZwebTestCase.php
SoftBankTestCase.php
Log:
- Migrated tests from .phpt to PHPUnit.
http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php?r1=1.12&r2=1.13&diff_format=u
Index: pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php
diff -u pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php:1.12 pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php:1.13
--- pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php:1.12 Wed May 7 13:26:23 2008
+++ pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php Sat May 10 09:25:13 2008
@@ -15,7 +15,7 @@
* @author KUBO Atsuhiro <[email protected]>
* @copyright 2008 KUBO Atsuhiro <[email protected]>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: DoCoMoTestCase.php,v 1.12 2008/05/07 13:26:23 kuboa Exp $
+ * @version CVS: $Id: DoCoMoTestCase.php,v 1.13 2008/05/10 09:25:13 kuboa Exp $
* @since File available since Release 0.31.0
*/
@@ -1338,6 +1338,22 @@
}
}
+ /**
+ * @since Method available since Release 1.0.0
+ */
+ public function testShouldProvideTheScreenInformationOfAUserAgent()
+ {
+ $agent = new Net_UserAgent_Mobile_DoCoMo('DoCoMo/2.0 P705iCL(c100;TB;W16H10)');
+ $display = $agent->getDisplay();
+
+ $this->assertEquals(240, $display->getWidth());
+ $this->assertEquals(350, $display->getHeight());
+ $this->assertTrue($display->isColor());
+ $this->assertEquals(262144, $display->getDepth());
+ $this->assertEquals(16, $display->getWidthBytes());
+ $this->assertEquals(10, $display->getHeightBytes());
+ }
+
/**#@-*/
/**#@+
http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php?r1=1.3&r2=1.4&diff_format=u
Index: pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php
diff -u pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php:1.3 pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php:1.4
--- pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php:1.3 Sat May 10 06:48:10 2008
+++ pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php Sat May 10 09:25:13 2008
@@ -15,7 +15,7 @@
* @author KUBO Atsuhiro <[email protected]>
* @copyright 2008 KUBO Atsuhiro <[email protected]>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: EZwebTestCase.php,v 1.3 2008/05/10 06:48:10 kuboa Exp $
+ * @version CVS: $Id: EZwebTestCase.php,v 1.4 2008/05/10 09:25:13 kuboa Exp $
* @since File available since Release 0.31.0
*/
@@ -313,6 +313,29 @@
$this->assertTrue($agent->isWAP1());
}
+ /**
+ * @since Method available since Release 1.0.0
+ */
+ public function testShouldProvideTheScreenInformationOfAUserAgent()
+ {
+ $_SERVER['HTTP_X_UP_DEVCAP_SCREENPIXELS'] = '90,70';
+ $_SERVER['HTTP_X_UP_DEVCAP_SCREENDEPTH'] = '16,RGB565';
+ $_SERVER['HTTP_X_UP_DEVCAP_ISCOLOR'] = '1';
+
+ $agent = new Net_UserAgent_Mobile_EZweb('KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1');
+
+ $display = $agent->getDisplay();
+
+ $this->assertEquals(90, $display->getWidth());
+ $this->assertEquals(70, $display->getHeight());
+ $this->assertTrue($display->isColor());
+ $this->assertEquals(65536, $display->getDepth());
+
+ unset($_SERVER['HTTP_X_UP_DEVCAP_ISCOLOR']);
+ unset($_SERVER['HTTP_X_UP_DEVCAP_SCREENDEPTH']);
+ unset($_SERVER['HTTP_X_UP_DEVCAP_SCREENPIXELS']);
+ }
+
/**#@-*/
/**#@+
http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php?r1=1.4&r2=1.5&diff_format=u
Index: pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php
diff -u pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php:1.4 pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php:1.5
--- pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php:1.4 Fri May 9 14:58:05 2008
+++ pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php Sat May 10 09:25:13 2008
@@ -15,7 +15,7 @@
* @author KUBO Atsuhiro <[email protected]>
* @copyright 2008 KUBO Atsuhiro <[email protected]>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: SoftBankTestCase.php,v 1.4 2008/05/09 14:58:05 kuboa Exp $
+ * @version CVS: $Id: SoftBankTestCase.php,v 1.5 2008/05/10 09:25:13 kuboa Exp $
* @since File available since Release 0.31.0
*/
@@ -322,6 +322,26 @@
unset($_SERVER['HTTP_X_JPHONE_MSNAME']);
}
+ /**
+ * @since Method available since Release 1.0.0
+ */
+ public function testShouldProvideTheScreenInformationOfAUserAgent()
+ {
+ $_SERVER['HTTP_X_JPHONE_DISPLAY'] = '120*117';
+ $_SERVER['HTTP_X_JPHONE_COLOR'] = 'C256';
+ $agent = new Net_UserAgent_Mobile_SoftBank('J-PHONE/2.0/J-DN02');
+
+ $display = $agent->getDisplay();
+
+ $this->assertEquals(120, $display->getWidth());
+ $this->assertEquals(117, $display->getHeight());
+ $this->assertTrue($display->isColor());
+ $this->assertEquals(256, $display->getDepth());
+
+ unset($_SERVER['HTTP_X_JPHONE_COLOR']);
+ unset($_SERVER['HTTP_X_JPHONE_DISPLAY']);
+ }
+
/**#@-*/
/**#@+