public function testSetConnection() { $connection = new PdoConnection('sqlite::memory:'); $manager = new ConnectionManagerSingle(); $manager->setConnection($connection); $conn = $manager->getWriteConnection(); $this->assertSame($connection, $conn); }
/** * Shortcut to define a single connectino for a datasource. * * @param string $name The datasource name * @param \Propel\Runtime\Connection\ConnectionInterface A database connection */ public function setConnection($name, ConnectionInterface $connection) { $manager = new ConnectionManagerSingle(); $manager->setConnection($connection); $this->setConnectionManager($name, $manager); }