【问题标题】:non test functions inside phpunit and selenium2phpunit 和 selenium2 中的非测试函数
【发布时间】:2013-06-28 09:31:26
【问题描述】:

我有一个函数,我希望能够从我的 selenium 测试中的不同函数调用。假设它看起来像这样:

class TestMyTest extends PHPUnit_Extensions_Selenium2TestCase {


    public function setUp()
    {
    $this->setHost('localhost');
    $this->setPort(4444);
    $this->setBrowser("chrome");
    $this->setBrowserUrl("https://XXXXXXXXXXXXXX");
    }


    public function foo()
    {
    $foo = array("foo", "bar", "foo_bar","bar_foo")
    return $foo;
    }

    public function testSelenium()
    {       
    var_dump(asd());
    }
}

当我运行它时,我得到了未定义的函数 foo。我所有的函数都必须以名称 test 开头,否则它们会变得未定义,这是不可能的吗?

【问题讨论】:

    标签: php function selenium phpunit


    【解决方案1】:

    好吧,我解决了这个问题,我唯一需要的就是像这样添加 $this-> var_dump($this->asd());

    【讨论】:

      猜你喜欢
      • 2013-01-24
      • 2018-05-12
      • 2015-02-24
      • 2015-04-02
      • 1970-01-01
      • 1970-01-01
      • 2015-09-29
      • 1970-01-01
      • 2013-12-05
      相关资源
      最近更新 更多