mblarsen / fFixture

Provides an easy way of creating sample data (fixtures) for unit testing using Flourish.
http://mblarsen.github.com/fFixture
2 stars 0 forks source link

Lazy loading #4

Closed mblarsen closed 12 years ago

mblarsen commented 12 years ago

At the moment fixtures are loaded all at once, this is hardly a problem for smalish data sets and a few unit tests.

Test speed could be improved a lot by only loading the relevant fixtures.

But besides that there is another advantage. By postponing loading things like named keys can be introduced:

shops.json

{
    "shop_id": <?php echo $this->setKey("amazon.de", 1); ?>
}

pages.json

[
{
   "page_id" : 1
   "shop_id": <?php echo $this->key("shops", "amazon.de"); ?>
}
]