php - 在受保护的 dataProvider 方法中获取固定装置
问题描述
我在我的 Codeception Cest 类中使用dataProvider 受保护的方法。
可以在 dataProvider 方法中获取固定装置吗?例如:
class PageCest
{
/**
* @dataProvider pageProvider
*/
public function staticPages(AcceptanceTester $I, \Codeception\Example $example)
{
$I->amOnPage($example['url']);
$I->see($example['title'], 'h1');
$I->seeInTitle($example['title']);
}
/**
* @return array
*/
protected function pageProvider(): array
{
// Here I want to use some like $I->grabFixture()
return [
['url'=>"/", 'title'=>"Welcome"],
['url'=>"/info", 'title'=>"Info"],
['url'=>"/about", 'title'=>"About Us"],
['url'=>"/contact", 'title'=>"Contact Us"]
];
}
}
解决方案
推荐阅读
- c# - 读取 TXT 文件并将其转换为 SQL 脚本
- php - Laravel 搜索参考第二个模型/集合/表与 orWhereHas?
- python - Python 不会将 pyomo 解释为一个包
- c++ - 为什么动态链接要花这么多时间?
- openssl - AES-256 加密/解密
- css - 请解释 WordPress 2019 主题的屏幕阅读器文本样式
- html - 不能在一侧设置边界半径,在另一侧设置常规边界
- oracle - 本地 Oracle Docker 实例的数据源名称
- apache-spark - Spark 与 Kubernetes 连接到 pod id,而不是地址
- api - 使用 Quip API,如何获取所有线程的列表?