我在20小时前开始使用phpunit。我昨天写了一些测试,现在看起来它们被缓存了。例如,这是我的3个测试:
public function test(){
$this->url("index.php");
$username = $this->byName('username');
$password = $this->byName('password');
$this->assertEquals("", $username->value());
$this->assertEquals("", $password->value());
}
public function testLoginFormSubmitsToAdmin()
{
$this->url("index.php");
$form = $this->byCssSelector('form');
$action = $form->attribute('action');
$this->assertContains('admin.php', $action);
$this->byName('username')->value('jeffry');
$this->byName('password')->value('123456');
$form->submit();
$welcome = $this->byCssSelector('h1')->text();
$this->assertRegExp('/(\w+){5}/i', $welcome);
}
public function testSubmit()
{
$this->url('index.php');
$this->assertFalse($this->byId('submit')->enabled());
$this->byName('username')->value('Az');
$this->byName('password')->value('1234567');
$this->assertTrue($this->byId('submit')->enabled());
}
现在我正在尝试创建新函数,如
public function todayTest(){ ... }
但它没有被执行。当我注释其他测试时,运行
phpunit TestLogin.php
我得到的是:
PHPUnit 6.5.7 by Sebastian Bergmann and contributors.
Time: 93 ms, Memory: 4.00MB
No tests executed!
好像我的功能不存在。如果我将新创建的函数的名称更改为昨天函数的名称,如-
public function test()
(将名称更改为
todayTest()
到
test()
)它工作得很好。在谷歌周围发布了一些红色帖子,发现了一些关于缓存的信息,但不知道如何清除它们。我能得到一些建议吗?非常感谢。
P、 我也在使用
Selenium 3.11.0