我想在我的drupal 7 模块中做一些测试。所以我遵循了drupal的SimpleTest Api并实施了一些测试
例如,我正在测试登录过程。
public function testLogin() {
$user = $this->drupalCreateUser(array());
$this->drupalLogin($user);
}
当我尝试登录时,我总是遇到这个异常:
Undefined property: MyModuleTest::$public_files_directory drupal_web_test_case.php 1692 DrupalWebTestCase->curlInitialize()
之后异常登录失败。
详细信息是这样的:
User created with name zPUkpgzN and pass 6NXRDGWy5k Pass
GET http://www.example.com/user returned 200 (1 byte). Pass
Valid HTML found on "http://www.example.com/user" Pass
Failed to set field name to zPUkpgzN Pass
Failed to set field pass to 6NXRDGWy5k Fail
Found the Log in button Fail
Found the requested form fields at user Fail
User zPUkpgzN successfully logged in. Fail
我发现这篇文章http://drupal.org/node/1789942,我遵循了一些建议,但我唯一成功的是:
User created with name zPUkpgzN and pass 6NXRDGWy5k Pass
GET http://www.example.com/user returned 200 (1 byte). Pass
Valid HTML found on "http://www.example.com/user" Pass
Failed to set field name to zPUkpgzN Pass
Failed to set field pass to 6NXRDGWy5k Pass
Found the Log in button Fail
Found the requested form fields at user Pass
User zPUkpgzN successfully logged in. Fail
有什么建议么?
谢谢。
桑登姆。