A backery for FactoryMuffin. For creating object by an alias including only setting the arguments during instantiating

dev-master 2017-03-26 10:22 UTC

This package is auto-updated.

Last update: 2022-01-15 01:51:49 UTC



A wrapper for Factory Muffin (


The Muffin class


setObjectClass: setting the full qualified class name

setCreatorMethod: setting the create method: create, instance, seed

setArguments: setting the arguments for the objects

setSeedTimes: setting the number of object to be created

setMaker: setting a maker function

setCallback: setting a callback function

Example Class:

namespace dknx01\FactoryMuffinBackery\Test;

class TestStub


use Dknx01\FactoryMuffinBundle\DVO\Muffin;
use Dknx01\FactoryMuffinBundle\MuffinBackery;
use League\FactoryMuffin\FactoryMuffin;
use League\FactoryMuffin\Stores\ModelStore;

class TestFactory
     * @var MuffinBackery
    private $backery;

    public function createObject()
        $this->backery = new MuffinBackery();
        $this->backery->setFactoryMuffin(new FactoryMuffin(new ModelStore()));

        $muffin = new Muffin();
        $this->backery->addMuffin($muffin, 'myStub');
    * @return MuffinBackery
    public function getBackery(): MuffinBackery
        return $this->backery;

Test class

class DefaultControllerTest extends TestCase
    public function testIndex()
        $factory = new TestFactory();