public function testinsertIntoDbdeleteFromDb() { $dbCon = RsOpenFBDbTestUtils::getDbCon(); $user = RsOpenFBDbTestUtils::getUser1(); $app = RsOpenFBDbTestUtils::getApp1(); try { $user->insertIntoDb($dbCon); } catch (Exception $exception) { // nothing on purpose } $appId = $app; $userId = $user->getId(); $id = null; try { $this->assertEquals(0, $this->getNumUserApp($appId, $userId)); $id = Api_Dao_UsersApp::createUsersApp($appId, $userId); $this->assertEquals(1, $this->getNumUserApp($appId, $userId)); $row = $this->getUserApp($appId, $userId); $this->assertEquals($id, $row['id']); } catch (Exception $exception) { try { Api_Dao_UsersApp::deleteUserApp($id); } catch (Exception $exception) { // nothing on purpose } $this->deleteUserAndApp($id, $app); throw $exception; } try { Api_Dao_UsersApp::deleteUserApp($id); $this->assertEquals(0, $this->getNumUserApp($appId, $userId)); } catch (Exception $exception) { $this->deleteUserAndApp($id, $app); throw $exception; } $this->deleteUserAndApp($id, $app); }
public function initApp() { $dbCon = RsOpenFBDbTestUtils::getDbCon(); $app1 = RsOpenFBDbTestUtils::getApp1(); $app2 = RsOpenFBDbTestUtils::getApp2(); }