Download the PHP package davjand/codecept-symphonycms-db without Composer
On this page you can find all versions of the php package davjand/codecept-symphonycms-db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davjand/codecept-symphonycms-db
More information about davjand/codecept-symphonycms-db
Files in davjand/codecept-symphonycms-db
Package codecept-symphonycms-db
Short Description Codeception SymphonyCMS Database Module
License
Informations about the package codecept-symphonycms-db
Readme
- Use this at your own risk.
- MIT License
- [email protected]
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.
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
Functions
symHaveFixtureInDatabase($fixture)
Load a yml file of data from your fixtures folder (see config above).
Format is
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.
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
symHaveEntriesInDatabase($sectionHandle,$data)
$data should be a multi-dimensional array in the format
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.