public function testCallbackOnAfterCreate() { $blueprint = new FixtureBlueprint('FixtureFactoryTest_DataObject'); $this->_called = 0; $self = $this; $cb = function ($obj, $identifier, $data, $fixtures) use($self) { $self->_called = $self->_called + 1; }; $blueprint->addCallback('afterCreate', $cb); $this->assertEquals(0, $this->_called); $obj1 = $blueprint->createObject('one'); $this->assertEquals(1, $this->_called); $obj2 = $blueprint->createObject('two'); $this->assertEquals(2, $this->_called); $this->_called = 0; }