2017 © Pedro Peláez
 

library codecept-symphonycms-db

Codeception SymphonyCMS Database Module

image

davjand/codecept-symphonycms-db

Codeception SymphonyCMS Database Module

  • Thursday, October 29, 2015
  • by davjand
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Readme

  • Use this at your own risk.
  • MIT License
  • dave@veodesign.co.uk

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

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, (*2)

2015-10-30 - Version: 0.2, (*3)

  • Renamed haveInDatabseFunctions
  • Added YML loading functionality

2015-10-29 - Version: 0.1, (*4)

  • 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, (*5)

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., (*6)

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

This will access the database through the settings in your manifest/config.php file., (*7)

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., (*8)

Config

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

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

Functions

symHaveFixtureInDatabase($fixture)

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

Format is, (*11)


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., (*12)

NB: It is not currently possible to associate entries in the same section together., (*13)

For Example., (*14)

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., (*15)

Subsequent sections can be related to each other using the %section:position% format as above, (*16)

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

symHaveEntriesInDatabase($sectionHandle,$data)

$data should be a multi-dimensional array in the format, (*17)

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

It returns an array of the inserted IDs, (*18)

symHaveEntryInDatabase($sectionHandle,$data)

Similar to symHaveInDatabase except exceptions only one entry. Accepts the data in key value format., (*19)

symUpdateDatabaseRecord($sectionHandle,$entryId,$data)

This will update an existing record with the data passed. Accepts the data in key value format., (*20)

The Versions

29/10 2015

dev-master

9999999-dev

Codeception SymphonyCMS Database Module

  Sources   Download

The Requires

 

The Development Requires

by David Andeson

29/10 2015

0.2

0.2.0.0

Codeception SymphonyCMS Database Module

  Sources   Download

The Requires

 

The Development Requires

by David Andeson

29/10 2015

0.1

0.1.0.0

Codeception SymphonyCMS Database Module

  Sources   Download

The Development Requires

by David Andeson