作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Liip\FunctionalTestBundle
对于单元测试,它工作得很好。
AppCategoryControllerTest.php:
class AppCategoryControllerTest extends BoEditoAuthWebTestCase
{
public function setUp()
{
parent::setUp();
// It returns an array of class paths
$this->loadFixtures($this->getAllDataFixtures());
}
//...
}
/**
* @BeforeScenario @createSchema
*
* load my fixtures with Liip\FunctionalTestBundle\Test\WebTestCase
*/
public function createDatabase()
{
// What can I do here?
}
最佳答案
由于这是一个 PHPUnit 测试用例,您不能直接在 Behat 中使用它。您需要在 Behat 上下文中复制该行为。
看看 SymfonyDoctrineContext来自 Behat/CommonContexts。这应该是一个很好的起点。上下文是为 Behat 2 编写的,因此您需要针对 Behat 3 对其进行调整。
I'm using Liip\FunctionalTestBundle for Unit testing, it works very well.
关于symfony - 如何在 Symfony2 中使用 Behat 和 Liip\FunctionalTestBundle?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34158978/
我是一名优秀的程序员,十分优秀!