【发布时间】:2018-11-16 23:24:03
【问题描述】:
我正在尝试根据https://github.com/yiisoft/yii2-app-basic/blob/master/README.md#testing执行codeception验收测试
我不明白为什么 yii serve 以 entryScript index.php 开头,而我期望 index-test.php。这会导致 YII_DEBUG = false 并因此无法将电子邮件保存到文件中。
这是我的 codeception.yml
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
coverage:
enabled: true
remote: false
c3_url: 'http://localhost:8080/index-test.php'
include:
- commands/*
- components/*
- controllers/*
- models/*
- modules/*
settings:
bootstrap: _bootstrap.php
memory_limit: 1024M
colors: true
modules:
config:
Yii2:
configFile: 'config/test.php'
entryScript: index-test.php
cleanup: false
这是我的acceptance.yml:
actor: AcceptanceTester
extensions:
enabled:
- Codeception\Extension\RunProcess:
- ./tests/bin/yii serve
- wait 2
modules:
enabled:
- WebDriver:
url: 'http://localhost:8080/'
window_size: 1920x1080
browser: chrome
capabilities:
chromeOptions:
args: ["--no-sandbox", "--headless", "--disable-gpu"]
binary: "/usr/bin/google-chrome-stable"
unexpectedAlertBehaviour: 'accept'
- Yii2:
part: [orm, email]
entryScript: index-test.php
我已将 c3.php 添加到我的 index-test.php。这是与原始文件的唯一对比。
【问题讨论】:
标签: php testing yii2 codeception