drop SimpleTest compatibility
This commit is contained in:
parent
8e09999130
commit
3d299fc1bb
1 changed files with 14 additions and 14 deletions
|
@ -6,36 +6,36 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
OC_App::loadApp('calendar');
|
||||
class Test_Calendar_Calendars extends UnitTestCase {
|
||||
class Test_Calendar_Calendars extends PHPUnit_Framework_TestCase {
|
||||
function testBasic() {
|
||||
$uid=uniqid();
|
||||
$this->assertEqual(OC_Calendar_Calendar::allCalendars($uid),array());
|
||||
$this->assertEquals(OC_Calendar_Calendar::allCalendars($uid),array());
|
||||
OC_User::setUserId($uid);
|
||||
$calId1=OC_Calendar_Calendar::addCalendar($uid,'test');
|
||||
|
||||
$all=OC_Calendar_Calendar::allCalendars($uid);
|
||||
$this->assertEqual(count($all),1);
|
||||
$this->assertEquals(count($all),1);
|
||||
|
||||
$this->assertEqual($all[0]['id'],$calId1);
|
||||
$this->assertEqual($all[0]['displayname'],'test');
|
||||
$this->assertEqual($all[0]['uri'],'test');
|
||||
$this->assertEqual($uid, $all[0]['userid']);
|
||||
$this->assertEquals($all[0]['id'],$calId1);
|
||||
$this->assertEquals($all[0]['displayname'],'test');
|
||||
$this->assertEquals($all[0]['uri'],'test');
|
||||
$this->assertEquals($uid, $all[0]['userid']);
|
||||
|
||||
$calId2=OC_Calendar_Calendar::addCalendar($uid,'test');
|
||||
$this->assertNotEqual($calId1, $calId2);
|
||||
$this->assertNotEquals($calId1, $calId2);
|
||||
|
||||
$all=OC_Calendar_Calendar::allCalendars($uid);
|
||||
$this->assertEqual(count($all),2);
|
||||
$this->assertEquals(count($all),2);
|
||||
|
||||
$this->assertEqual($all[1]['id'],$calId2);
|
||||
$this->assertEqual($all[1]['displayname'],'test');
|
||||
$this->assertEqual($all[1]['uri'],'test1');
|
||||
$this->assertEquals($all[1]['id'],$calId2);
|
||||
$this->assertEquals($all[1]['displayname'],'test');
|
||||
$this->assertEquals($all[1]['uri'],'test1');
|
||||
|
||||
//$cal1=OC_Calendar_Calendar::find($calId1);
|
||||
//$this->assertEqual($cal1,$all[0]);
|
||||
//$this->assertEquals($cal1,$all[0]);
|
||||
|
||||
OC_Calendar_Calendar::deleteCalendar($calId1);
|
||||
OC_Calendar_Calendar::deleteCalendar($calId2);
|
||||
$this->assertEqual(OC_Calendar_Calendar::allCalendars($uid),array());
|
||||
$this->assertEquals(OC_Calendar_Calendar::allCalendars($uid),array());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue