function test_factory_for_thing_create_should_use_function_generator() { $generation_defintions = array('full_name' => GP_UnitTest_Factory_For_Thing::callback(create_function('$o', 'return $o->name . " baba";'))); $factory = $this->create_factory(null, $generation_defintions); $create_args = array('name' => 'my name is'); $updated_args = array('full_name' => 'my name is baba'); $thing = $this->create_thing_stub_with_name_and_full_name_which_on_create_returns_mock_whose_save_should_be_called_with($create_args, $updated_args); $factory->thing = $thing; $factory->create($create_args); }
function __construct($factory = null, $thing = null) { parent::__construct($factory, $thing ? $thing : new GP_Glossary()); $this->default_generation_definitions = array('description' => new GP_UnitTest_Generator_Sequence('Glossary Set %s'), 'translation_set_id' => 1); }