当前位置: 首页>>代码示例>>PHP>>正文


PHP DAOFactory::getDao方法代码示例

本文整理汇总了PHP中DAOFactory::getDao方法的典型用法代码示例。如果您正苦于以下问题:PHP DAOFactory::getDao方法的具体用法?PHP DAOFactory::getDao怎么用?PHP DAOFactory::getDao使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DAOFactory的用法示例。


在下文中一共展示了DAOFactory::getDao方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLoginByCookie

 public function testLoginByCookie()
 {
     $email = 'me@example.com';
     $cookie_dao = DAOFactory::getDao('CookieDAO');
     $cookie = $cookie_dao->generateForEmail($email);
     $this->get($this->url . '/index.php');
     $this->assertNoText($email);
     $this->getBrowser()->setCookie(Session::COOKIE_NAME, $cookie);
     $this->get($this->url . '/index.php');
     $this->assertText($email);
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:11,代码来源:WebTestOfLogin.php

示例2: testLoginSuccessAndPrivateDashboard

 public function testLoginSuccessAndPrivateDashboard()
 {
     $email = 'me@example.com';
     $cookie_dao = DAOFactory::getDao('CookieDAO');
     $deleted = $cookie_dao->deleteByEmail($email);
     $this->assertFalse($deleted);
     $this->get($this->url . '/session/login.php');
     $this->setField('email', $email);
     $this->setField('pwd', 'secretpassword');
     $this->click("Log In");
     $this->get($this->url . '/dashboard.php');
     $this->assertTitle("thinkupapp's Dashboard | " . Config::getInstance()->getValue('app_title_prefix') . "ThinkUp");
     $this->assertText('Logged in as admin: ' . $email);
     $cookie = $this->getBrowser()->getCurrentCookieValue(Session::COOKIE_NAME);
     $deleted = $cookie_dao->deleteByEmail($email);
     $this->assertTrue($deleted);
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:17,代码来源:WebTestOfLogin.php

示例3: testDeleteInstance

 public function testDeleteInstance()
 {
     $email = 'me@example.com';
     $cookie_dao = DAOFactory::getDao('CookieDAO');
     $cookie = $cookie_dao->generateForEmail($email);
     $this->get($this->url . '/index.php');
     $this->assertNoText($email);
     $this->getBrowser()->setCookie(Session::COOKIE_NAME, $cookie);
     $this->get($this->url . '/index.php');
     $this->assertText($email);
     $this->click("Settings");
     $this->get($this->url . '/account/index.php?p=twitter#manage_plugin');
     $this->assertLink('@ev');
     $this->assertLink('@thinkupapp');
     $this->assertLink('@linkbaiter');
     $this->assertLink('@shutterbug');
     $this->assertPattern('/Remove an account/');
     //delete existing instance
     $this->post($this->url . '/account/index.php?p=twitter', array('action' => 'Delete', 'instance_id' => '3', 'csrf_token' => self::TEST_CSRF_TOKEN));
     $this->assertPattern("/Account deleted\\./");
     $this->assertLink('@thinkupapp');
     $this->assertLink('@linkbaiter');
     $this->assertNoLink('@shutterbug');
     $this->assertPattern('/Remove an account/');
     //delete non-existent instance
     $this->post($this->url . '/account/index.php?p=twitter', array('action' => 'Delete', 'instance_id' => '231', 'csrf_token' => self::TEST_CSRF_TOKEN));
     $this->assertPattern("/Could not find that account\\./");
     $this->assertLink('@thinkupapp');
     $this->assertLink('@linkbaiter');
     $this->assertPattern('/Remove an account/');
     $this->click('Log out');
     //        $this->assertText('You have successfully logged out');
     //        $this->showSource();
     $this->assertText("Log in");
     $this->get($this->url . '/session/login.php');
     $this->setField('email', 'me2@example.com');
     $this->setField('pwd', 'secretpassword');
     $this->click("Log In");
     //delete instance with no privileges
     $this->post($this->url . '/account/index.php?p=twitter', array('action' => 'Delete', 'instance_id' => '2', 'csrf_token' => self::TEST_CSRF_TOKEN));
     $this->assertPattern("/Insufficient privileges\\./");
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:42,代码来源:WebTestOfDeleteInstance.php

示例4: testLogout

 public function testLogout()
 {
     $email = 'me@example.com';
     $cookie_dao = DAOFactory::getDao('CookieDAO');
     $deleted = $cookie_dao->deleteByEmail($email);
     $this->assertFalse($deleted);
     $this->get($this->url . '/session/login.php');
     $this->setField('email', $email);
     $this->setField('pwd', 'secretpassword');
     $this->click("Log In");
     $this->get($this->url . '/index.php');
     $this->assertTitle(Config::getInstance()->getValue('app_title_prefix') . "ThinkUp");
     $this->assertText($email);
     $cookie = $this->getBrowser()->getCurrentCookieValue(Session::COOKIE_NAME);
     $this->get($this->url . '/session/logout.php');
     $cookie = $this->getBrowser()->getCurrentCookieValue(Session::COOKIE_NAME);
     $this->assertEqual('deleted', $cookie);
     $this->get($this->url . '/index.php');
     $this->assertNoText($email);
     $deleted = $cookie_dao->deleteByEmail($email);
     $this->assertFalse($deleted);
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:22,代码来源:WebTestOfLogout.php


注:本文中的DAOFactory::getDao方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。