alsbury/malice
Composer 安装命令:
composer require alsbury/malice
包简介
Symfony bundle and Codeception fixtures module
README 文档
README
Codeception module for working with Alice/Faker fixtures in conjunction with AliceBundle.
This is an early prototype. Feedback is welcome.
Installation:
composer require alsbury/malice
Configure Codeception Test Suites
Add module to codeception test suite YAML file:
class_name: FunctionalTester
modules:
enabled:
- Symfony2:
app_path: '../../../app'
var_path: '../../../var'
environment: 'test'
- \Component\Registration\Tests\Helper\Functional
- \Alsbury\Malice\Component\Codeception\Module\Malice:
drop_create: true
Example test that loads fixtures defined in a bundle, specified by Doctrine annotations:
<?php
use Alsbury\Malice\Component\Annotation\Fixture;
/**
* @Fixture("MyBundle:Foo.yml")
* @Fixture("MyBundle:Bar.yml")
* @Fixture("AnotherBundle:AnotherFoo.yml")
*/
class AccountCreatorTest extends \Codeception\TestCase\Test
{
/**
* @Fixture("MyBundle:MethodSpecificFoo.yml")
*/
public function testNothing()
{
$this->assertEquals(true, true);
}
public function testSomeOtherNothing()
{
$this->assertEquals(true,true);
}
}
Setup fixtures per the hautelook/alice-bundle spec. Fixtures definition files Foo.yml are expected
to be in the directory DataFixtures/ORM in the specific bundle directory. Each fixture needs to have
its own annotation as noted in the sample above, containing the bundle name, followed by a colon, then the
fixture yaml file MyBundle:Foo.yml. Fixture annotations for the class will apply to all methods in that
class. Fixture annotations for a method will be added to the class fixtures for that specific test only.
Fixture environments are not currently supported.
Requirements
- Symfony 2 or 3
- Codeception 2.1+ with Symfony 2 module
- hautelook/alice-bundle
统计信息
- 总下载量: 15.37k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-15