phpunit ??????????--???????
???????????? ???????[ 2013/12/24 11:52:08 ] ????????phpunit ??????? ????
????????????л????Щ???÷?????????????г???????????????????????
<?php
/**
* ????????????
*
* @author shayang88
* @since 2013-11-27
* @copyright Copyright (c) 2005-2012 Inc.
* @desc
*
*/
require_once dirname(__FILE__) . '/../../webroot/bootstrap.php';
class test_sign_task extends PHPUnit_Framework_TestCase
{
public $testUid = 5888882; //????????????id
/**
* ??????????????????????2?????е???????????????????????
*/
public function testClear(){
//??????б????????????????????????
$taskModel = new GuaziTaskModel();
$taskModel->clearTask($this->testUid?? 'sign');
//??????????????????????????????????
$signModel = new GuaziSignModel();
$signModel->getCollection()->update(array('uid' => $this->testUid )?? array('$unset' => array ('last_time' => 1?? 'sign_time' => 1)));
}
/**
* ???????????????????????????????????
*/
public function testEmpty(){
//??????????????????
$objSignTask = Task_Factory::factory('sign');
$signStatus = $objSignTask->getStatus($this->testUid);
//?????????????????????????0??????
$this->assertEquals(0?? $signStatus);
//????????????????
$signModel = new GuaziSignModel();
$arrsign = $signModel->getSignByUid($this->testUid);
//??????????????????????Σ???????NULL??????
$this->assertNull($arrsign['n_t']);
$this->assertNull($arrsign['t']);
}
/**
* ????????????????????????????????????????????????????????testSign???????????
* ??????????????????÷?@dataProvider
* @return array
*/
public function dataProducer() {
//?????????
//??1????????????????2?????????????????????3??????????????
return array(
array('2013-11-25 19:30'?? 1?? 1)??
array('2013-11-26 18:30'?? 2?? 2)??
array('2013-11-27 10:30'?? 3?? 3)??
array('2013-11-28 23:59'?? 4?? 4)??
array('2013-11-29 22:59'?? 5?? 4)??
);
}
/**
* @dataProvider dataProducer
*/
public function testSign($nowTime??$signCount??$taskStatus)
{
//???????dataProducer???????????????3????????????????????
$now = strtotime($nowTime);
$signModel = new GuaziSignModel();
//?????????????????
$objSignTask = Task_Factory::factory('sign');
//????????????????????????????????????
$doTaskRes = $objSignTask->doTaskForPhpunit($this->testUid?? $now);
//??????н??
$this->assertEquals(1?? $doTaskRes);
//?????????
$signStatus = $objSignTask->getStatus($this->testUid);
//??????????
$this->assertEquals($taskStatus?? $signStatus);
//??????????????
$ret = $signModel->updateLastSign($this->testUid??$now);
//???????????????
$this->assertCount($signCount?? $ret['t']);
}
}
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
iOS???????mocha??chai??sinon??istanbul???????????????????????????????????????д?????Java????????7??????Android?????????Robolectric3.0????(?)???Kiwi?????????????????????????????????Python?????????????????????????????????????Controller????????д?????????10???????????????????Angular????????????Component??Directive??Pipe ???ServiceAndroid????????????????????????????????--Mockito??????iOS UnitTest???????Vue?????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????