davjand/codecept-symphonycms-db 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

davjand/codecept-symphonycms-db

Composer 安装命令:

composer require davjand/codecept-symphonycms-db

包简介

Codeception SymphonyCMS Database Module

README 文档

README

A codeception module to facilitate integration with Symphony CMS (http://getsymphony.com).

This is intended to be used in conjunction with the existing Db module for setup/teardown of databases. It currently offers functions putting your own fixture data into the database

2015-10-30 - Version: 0.2

  • Renamed haveInDatabseFunctions
  • Added YML loading functionality

2015-10-29 - Version: 0.1

  • Initial Release

Setup

The module has no configuration parameters however you must define the symphony DOCROOT within your bootstrap.php file for this to work

An older version of symphony is included in the repository (the repo was developed for testing an old repo) however by changing the path below to your included symphony source that you are testing you can use that.

define('DOCROOT',__DIR__ . '/../symphony/2.3.6/');

This will access the database through the settings in your manifest/config.php file.

Please note that in some environments, you need to have your host as 127.0.0.1 for the database rather than localhost for using with codeception.

Config

Enable in your configuration file as below. You can define a custom path to your fixtures folder for included yml fixtures

modules:
    config:
        SymphonyCMSDb:
            fixtures: 'tests/_fixtures'

Functions

symHaveFixtureInDatabase($fixture)

Load a yml file of data from your fixtures folder (see config above).

Format is

secton-handle:
    -
        field-name-one: 'value'
        field-name-two: 'value2'

Subsequent entries can be associated with previous entries using the format %section:position% as seen in the example below. The position starts at 1, not 0. The section with the relation must be defined after the entry it is being related to or an error will be thrown.

NB: It is not currently possible to associate entries in the same section together.

For Example.

people:
    -
        first-name: 'James'
        last-name: 'Bond'
    -
        first-name: 'Daniel'
        last-name: 'Craig'
dogs:
    -
        name: 'Rover'
        owner: '%people:2%'

symHaveInDatabase($data)

Inserts multiple sections data into the database in one go.

Subsequent sections can be related to each other using the %section:position% format as above

array(
    'section-name' => array(
        array(
            'field-name': value
            'field-name': value
            ),
    )
);

symHaveEntriesInDatabase($sectionHandle,$data)

$data should be a multi-dimensional array in the format

array(
    array(
        'field-name': value
        'field_name': value
        ),
    etc
    );

It returns an array of the inserted IDs

symHaveEntryInDatabase($sectionHandle,$data)

Similar to symHaveInDatabase except exceptions only one entry. Accepts the data in key value format.

symUpdateDatabaseRecord($sectionHandle,$entryId,$data)

This will update an existing record with the data passed. Accepts the data in key value format.

davjand/codecept-symphonycms-db 适用场景与选型建议

davjand/codecept-symphonycms-db 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 10 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 davjand/codecept-symphonycms-db 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 davjand/codecept-symphonycms-db 我们能提供哪些服务?
定制开发 / 二次开发

基于 davjand/codecept-symphonycms-db 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-10-29