⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login_test.class.php

📁 一个用PHP编写的
💻 PHP
字号:
<?php	include_once( PLOG_CLASS_PATH."class/test/helpers/lifetypetestcase.class.php" );	include_once( PLOG_CLASS_PATH."class/test/helpers/testtools.class.php" );			/**	 * \ingroup Test	 */	class Login_Test extends LifeTypeTestCase	{		function setUp()		{			$this->user = TestTools::createUser();			$this->user2 = TestTools::createUser();			$this->blog = TestTools::createBlog( $this->user2->getId());		}				function tearDown()		{			TestTools::deleteDaoTestData( Array( $this->user, $this->user2, $this->blog ));		}				/**		 * check that the login page is working as expected		 */		function testLoginPage()		{			$this->assertUIScript(				Array(					"login_page" => Array(						"url" => $this->getAdminUrl(),						"type" => "get",						"expected" => "Welcome to LifeType",						"message" => "The login screen did not display the right message"					)				)			);		}				/**		 * Test that a user without a blog cannot login		 */		function testUserHasNoBlog()		{			$this->assertUIScript(				Array(					"login_page" => Array(						"url" => $this->getAdminUrl(),						"type" => "post",						"params" => Array(							"userName" => $this->user->getUserName(),							"userPassword" => "password",							"op" => "Login"						),						"expected" => "you do not belong to any blog yet",						"message" => "User was not warned that he did not belong to any blog yet"					)				)			);					}				/**		 * Test the whoe login and logout process		 */		function testLoginLogout()		{			$this->assertUIScript(				Array(					"login" => Array(						"url" => $this->getAdminUrl(),						"type" => "post",						"params" => Array(							"userName" => $this->user2->getUserName(),							"userPassword" => "password",							"op" => "Login"						),						"expected" => "Dashboard",						"message" => "The dashboard did not appear when logging in"					 ),					"select_blog" => Array(						"url" => $this->getAdminUrl(),						"type" => "get",						"params" => Array(							"op" => "blogSelect",							"blogId" => $this->blog->getId()						),						"expected" => "New Post",						"message" => "The blog could not be selected after the dashboard"					),					"logout" => Array(						"url" => $this->getAdminUrl(),						"type" => "get",						"params" => Array( "op" => "Logout" ),						"expected" => "You have been successfully logged out",						"message" => "The logout screen was not displayed correctly"					)				)			);								}	}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -