/** @test */ public function it_registers_a_table_gateway_and_returns_it_upon_request() { $tableGatewayInstance = TableGatewayFactory::create('people', new Dsn('memory')); TableGatewayFactory::register('people', $tableGatewayInstance); $tableGateway = TableGatewayFactory::get('people'); $this->assertEquals($tableGatewayInstance, $tableGateway); }
protected function setUp() { // TableGateway can be created through static constructor $tableGatewayInstance = TableGatewayFactory::create('people', new Dsn('memory')); // A TableGateway instance can be registered to be accessed as a singleton // through the TableGateway::get('table') method. TableGatewayFactory::register('people', $tableGatewayInstance); }