woledzki / phabric Goto Github PK
View Code? Open in Web Editor NEWA DB mockup / fixture creation library for Behat
Home Page: http://ben-waine.co.uk/blog
License: MIT License
A DB mockup / fixture creation library for Behat
Home Page: http://ben-waine.co.uk/blog
License: MIT License
is there such a bundle, sf2 is ready for this now @everzet ?
I did see a setDataTransformation on the readme but not on the examples
It occurred to me that this could fairly easily be simplified to support usage in non-behat scenarios - such as PHPUnit.
Required steps:
Add Phabric->insert and ->update methods which take the entity and an array of associative arrays.
Replace Entity->insertFromTable and updateFromTable with insert/update on pure arrays
Modify Phabric->insertFromTable and Phabric->updateFromTable to extract arrays from the TableNode and call insert/update
You could either remove the TableNode typehint and replace it with a runtime check on the full namespaced TableNode to avoid having the reference to Gherkin hard coded, or attempt to figure out how to only define the function if Gherkin is available. This part I'm not sure about yet.
I did see a setDataTransformation on the readme but not in the examples
Currently no escaping.
Have to think how to implement this / also is it necessary.
Not a customer facing?
I think Phabric extension for Behat would make it easier to install and configure since:
Extension could be implemented either in current Phabric project or a new one (PhabricExtension?).
I'm eager to work on this.
Use set and add for name and data transformations.
Remove register.
also change translation to transform
To reproduce the bug:
Get phabric
Install dependencies with composer
curl -s http://getcomposer.org/installer | php
php composer.phar --dev install
Run tests
phpunit
Result: lots of "ReflectionException: Class Behat\Gherkin\Node\TableNode does not exist" errors due to missing Gherkin
Expected result: tests pass
For some reason Gherkin was removed from the dependency list in ae07848.
Need to move autoloading to avoid bloat in the autoloading chain.
Need to arrange config for db access to be available at this point.
Having had a chance to play with Phabric I think there are some great ideas here but the project feels very half-baked, is lacking integration and functionality and doesn't seem to have had much progress over the last year or so.
So where is the project going? Are people still interested? Are there still ideas people are working on and is anyone dedicating much time to the project? Has an alternative come along which surpasses it?
Find out what licence to use and put it in the code.
Method should take a 'parameters' array and create all entities using the keys on the entities array.
Currently Doctrine DBAL is hardcoded into the class (type hinting in entity and phabric).
Abstract this away using an interface and write a Doctrine DBAL adapter.
Throwing an exception in the constructor for bad values being passed in.
Especially necessary in the config path as potential for elements to be left out etc.
Phabric's work is to insert some data and work with it, and consider existing data mapping read is not implemented in the adapter
so subclass the adapter?
Useful data translations like UP DOWN, UKTOMYSQLDATE
implement:
$entity = $phabric->createFromGherkin('nameOfEntity', $table);
Remove the factory and place it's functionality in the Bus.
Rename Bus > Phabric
Rename Phabric\Phabric -> Entity
As we already have insert...()
and update...()
methods, i think it would be useful to have a simple method to clean test entity. Like
<?php
$phabric->clean('event');
$phabric->getEntity('event')->clean();
Would work roughly the same as update, only it would allow you to delete entities from steps.
Currently only updating values that were inserted by Phabric Is supported. Add ability to update other elements of the fixture.
My personal opinion here is that only structure should be added in the initial sql fixture and perhaps some boiler plate data (like an admin user). However after talking with a few others it seems this functionality is in demand.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.