public function testGetUid() { $carrier = Lib3gkCarrier::get_instance(); //#28 softbank jphoneの端末ID取得時にエラー // $carrier->_carrier = KTAI_CARRIER_SOFTBANK; $str = $this->Lib3gkTools->get_uid(); $this->assertFalse($str); //PCでは必ずfalseになるのでエラーが出ないことだけを確認 }
/** * キャリア関連サブクラスの読み込み * * @return (なし) * @access private */ function __load_carrier() { if (!class_exists('lib3gkecarrier')) { require_once dirname(__FILE__) . '/lib3gk_carrier.php'; } $this->__carrier = Lib3gkCarrier::get_instance(); }
/** * キャリア関連サブクラスの読み込み * * @return (なし) * @access private */ function __load_carrier() { if (!class_exists('lib3gkecarrier')) { require_once dirname(__FILE__) . '/lib3gk_carrier.php'; } $this->__carrier = Lib3gkCarrier::get_instance(); $this->_params = array_merge($this->__carrier->_params, $this->_params); $this->__carrier->_params =& $this->_params; }
public function testFont() { $carrier = Lib3gkCarrier::get_instance(); $carrier->get_carrier('', true); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals(null, $result); $result = $this->Lib3gkHtml->font(); $this->assertEquals(null, $result); $user_agent = 'DoCoMo/2.0 P906i(c100;TB;W24H15)'; $carrier->get_carrier($user_agent, true); $this->Lib3gkHtml->_params['use_xml'] = false; $this->Lib3gkHtml->_params['style'] = array('teststyle' => 'color: red;'); $result = $this->Lib3gkHtml->font(); $this->assertEquals(null, $result); $result = $this->Lib3gkHtml->_params['use_xml'] = true; $result = $this->Lib3gkHtml->font(); $this->assertEquals('<div style="font-size: medium;">', $result); $result = $this->Lib3gkHtml->font(null, 'div'); $this->assertEquals('<div style="font-size: medium;">', $result); $result = $this->Lib3gkHtml->font(null, null, 'teststyle'); $this->assertEquals('<div style="font-size: medium;color: red;">', $result); $user_agent = 'KDDI-KC3Z UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0'; $carrier->get_carrier($user_agent, true); $result = $this->Lib3gkHtml->font(); $this->assertEquals('<font style="font-size: 22px;">', $result); $result = $this->Lib3gkHtml->font(null, 'div'); $this->assertEquals('<div style="font-size: 22px;">', $result); $result = $this->Lib3gkHtml->font(null, null, 'teststyle'); $this->assertEquals('<font style="font-size: 22px;color: red;">', $result); $user_agent = 'SoftBank/1.0/840SH/SHJ001/0123456789 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1'; $carrier->get_carrier($user_agent, true); $result = $this->Lib3gkHtml->font(); $this->assertEquals('<font style="font-size: medium;">', $result); $result = $this->Lib3gkHtml->font(null, 'div'); $this->assertEquals('<div style="font-size: medium;">', $result); $result = $this->Lib3gkHtml->font(null, null, 'teststyle'); $this->assertEquals('<font style="font-size: medium;color: red;">', $result); $user_agent = 'SoftBank/2.0/945SH/SHJ001/0123456789 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1'; $carrier->get_carrier($user_agent, true); $result = $this->Lib3gkHtml->font(); $this->assertEquals('<font style="font-size: large;">', $result); $result = $this->Lib3gkHtml->font(null, 'div'); $this->assertEquals('<div style="font-size: large;">', $result); $result = $this->Lib3gkHtml->font(null, null, 'teststyle'); $this->assertEquals('<font style="font-size: large;color: red;">', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</font>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</div>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</font>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</font>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</div>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</font>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</font>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</div>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</font>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</div>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</div>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals('</div>', $result); $result = $this->Lib3gkHtml->fontend(); $this->assertEquals(null, $result); }