Permalink
Commits on Jun 10, 2013
  1. explicitely allow callables that are not closures

    Instead of implicitely calling `$closure()` within the code for getting
    the value to set, `call_user_func` is now being used. As of now a simple
    callable like `array($this, 'methodName')` is already functioning, but it
    was not in the API docs (as executing `$array()` is not common knowledge).
    
    You can now use static calls:
    
    DataGenerator::fill($this->document, array(
        DataGenerator::OPTION_FIELD_VALUES => array(
            'fieldname' => 'Dat0r\\Tests\\Core\\Runtime\\Sham\\DataGeneratorTest::getStaticTrololo'
        )
    ));
    
    or array syntax for method calls:
    
    DataGenerator::fill($this->document, array(
        DataGenerator::OPTION_FIELD_VALUES => array(
            'fieldname' => array($this, 'getTrololo')
        )
    ));
    graste committed Jun 10, 2013
Commits on May 16, 2013
  1. Final non-static refactoring of DataGenerator

    You can now get an instance of the DataGenerator class and use it in a
    non-static way. The static helper methods are still available to ease the
    use. The protected static methods are now non-static.
    graste committed May 16, 2013
  2. first step in refactoring the Sham\DataGenerator

    The DataGenerator grew a bit large and the fake data generation was a big
    switch case block for each known and supported field type. The single
    strategies to generate fake data for a specific type have now been
    extracted into methods.
    
    The TODO item was added as it seems, that references and aggregate do not
    trigger change events upon changes to those fields.
    graste committed May 16, 2013
Commits on May 15, 2013
  1. add ReferenceField support to Sham\DataGenerator

    Reference fields can now be filled with fake data as well. As Dat0r does
    not persist anything the resulting reference field array only contains the
    identifier fieldname and module name (even though a whole document was
    added to the reference field DocumentCollection)
    graste committed May 15, 2013
Commits on May 14, 2013
  1. improved data generation and tests

    BooleanField and TextCollectionField are now tested and supported. The
    TextFieldGuesser now knows more fieldnames (like latitude, longitude
    etc.).
    graste committed May 14, 2013
  2. added DataGenerator::createDataFor($module) method

    This method returns an array with fieldname => value entries to be used
    elsewhere when in need for example data for a module or document.
    graste committed May 14, 2013
Commits on May 13, 2013
  1. add guessing of provider by name for textfields

    By default the fake data generation tries to guess a more specific
    provider by mapping the given name to a more specific fake data provider,
    e.g. 'email' as fieldname leads to an email being generated.
    
    You can disable this guessing feature by providing the options array key
    'guess_provider_by_name' => false.
    graste committed May 13, 2013
  2. add CHANGELOG, TODO and AUTHORS. Adjust README.

    README changes are version information, mention of new files and a lot of
    trailing whitespace fixes.
    graste committed May 13, 2013
  3. new excluded_fields option for Sham\DataGenerator

    It is now possible to exclude fields from being filled with fake data by
    using the excluded_fields options array key to specify names of fields to
    ignore when setting values.
    graste committed May 13, 2013
  4. add doc hint and test for InvalidValueException

    That exception is thrown by the setValue() method if the given (fake)
    value is not valid to set on the given field.
    graste committed May 13, 2013
  5. introduce constants for option keys and fix docs

    Introduce constants for the options array keys used. Rename 'fields' to
    'field_values' as that is a bit more verbose and future proof. Adjusted
    api docs to be a bit more concise.
    graste committed May 13, 2013
Commits on May 10, 2013
  1. added fake data generator to dat0r core

    Added a Dat0r\Core\Runtime\Sham\DataGenerator class to create new
    documents with fake data or fill existing documents with fake data. See
    the tests or doc comments for more information about usage.
    
    This change introduces fzaninotto/faker as a dependency for Dat0r. The lib
    is used to create fake data for the documents.
    graste committed May 10, 2013
Commits on May 7, 2013
  1. introduce simple theme for dat0r docs

    To test the customizability and theming of the sami lib a few simple
    customizations are introduced via a new theme that extends the enhanced
    theme provided by sami itself.
    graste committed May 7, 2013
  2. fix misconfigured tests introduced in last commit

    To test the library you have to run "make update && make test" instead of
    "make install && make test" to prevent too many dependencies when using
    Dat0r in production environments. Removed now deprecated files as well.
    graste committed May 7, 2013
  3. replace phpdocumentor with sami api docs generator

    As phpdocumentor and its dependencies could once again not be resolved
    automatically by composer it is now being replaced by sami/sami. The
    generated documentation (via make doc) will now be placed into the new
    "build/docs" folder. The code coverage reports created via "make test" can
    now be found in the "build/reports" directory. The "build" directory is
    added to the .gitignore file as it only contains repeatable generated
    code.
    graste committed May 7, 2013