昨天工作中的PHPUnit cahces功能

昨天工作中的PHPUnit cahces功能,phpunit,Phpunit,我在20小时前开始使用phpunit。昨天我写了一些测试,现在看起来它们被缓存了。例如,这是我的3个测试: public function test(){ $this->url("index.php"); $username = $this->byName('username'); $password = $this->byName('password'); $this->assertEquals("",

我在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()
),则效果良好。在谷歌周围发了一些红色的帖子,发现了一些关于缓存的东西,但不知道如何清除它们。我能得到一些建议吗?谢谢大家!

另外,我还使用了
Selenium 3.11.0

现在我正在尝试创建新函数,比如public function todayTest(){…},但它没有被执行

它不起作用,因为它没有按照PHPUnit遵循的规则命名

说明了如何命名文件、类和方法:

  • 这些测试是名为
    test*
    的公共方法

    或者,您可以在方法的docblock中使用
    @test
    注释将其标记为测试方法

  • 由于您可能不使用,因此方法
    todayTest()
    不是一个测试,而是一个助手方法。将其重命名为
    testToday()
    ,PHPUnit将运行它

    现在我正在尝试创建新函数,比如public function todayTest(){…},但它没有被执行

    它不起作用,因为它没有按照PHPUnit遵循的规则命名

    说明了如何命名文件、类和方法:

  • 这些测试是名为
    test*
    的公共方法

    或者,您可以在方法的docblock中使用
    @test
    注释将其标记为测试方法


  • 由于您可能不使用,因此方法
    todayTest()
    不是一个测试,而是一个助手方法。将其重命名为
    testToday()
    ,PHPUnit将运行它。

    PHPUnit不使用任何缓存。PHPUnit不使用任何缓存。谢谢!我只在课堂上看到这个。现在它工作了:)我会尽快用绿色标记它。谢谢!我只在课堂上看到这个。现在它工作了:)我会尽快用绿色标记它。