定制 bscheshirwork/codeception-db-yii2-config 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bscheshirwork/codeception-db-yii2-config

最新稳定版本:v2.0.0

Composer 安装命令:

composer require bscheshirwork/codeception-db-yii2-config

包简介

Connection 'Db' codeception module to 'Yii2' module database settings

README 文档

README

Connection 'Db' codeception module to 'Yii2' codeception module database settings

NO MORE db settings in codeception.yml!

Delete duplicate settings dsn, username, password, look at this:

Example backend/codeception.yml

namespace: backend\tests
actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
settings:
    bootstrap: _bootstrap.php
    colors: true
    memory_limit: 1024M
extensions:
    enabled:
        - Codeception\Extension\RunFailed
modules:
    config:
        Yii2:
            configFile: 'config/test-local.php'

Example common/config/main-local.php (included in backend/config/test-local.php)

<?php
return [
    'components' => [
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=db;dbname=yii2advanced',
            'username' => 'yii2advanced',
            'password' => 'yii2advanced',
            'charset' => 'utf8',
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
            // send all mails to a file by default. You have to set
            // 'useFileTransport' to false and configure a transport
            // for the mailer to send real emails.
            'useFileTransport' => true,
        ],
    ],
];

Example backend/tests/acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
# See docker-codeception-run/docker-compose.yml: "ports" of service "nginx" is null; the selenium service named "firefox"
# See nginx-conf/nginx.conf: listen 80 for frontend; listen 8080 for backend
        - WebDriver:
            url: http://nginx:8080/
            host: firefox
            port: 4444
            browser: firefox
        - \bscheshirwork\Codeception\Module\DbYii2Config:
            dump: ../common/tests/_data/dump.sql #relative path from "codeception.yml"
        - Yii2:
            part:
              - email
              - ORM
              - Fixtures

Note: the Db module is first (restore dump), the Yii2 module is second (load fixtures)

Installation

Add to you test environmentcomposer.json

    "require": {
        "bscheshirwork/codeception-db-yii2-config": "^2.0"
    }

统计信息

  • 总下载量: 47.89k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-21