Skip to content

Commit e0cf5bc

Browse files
committed
Fix using schema option with connection option
1 parent 0ef61fc commit e0cf5bc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Phinx/Db/Adapter/PostgresAdapterTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,21 @@ public function testConnectionWithSchema()
148148
$this->assertTrue($adapter->hasTable('foo.' . $adapter->getSchemaTableName()));
149149
}
150150

151+
public function testConnectionWithSchemaAndConnection()
152+
{
153+
$this->adapter->connect();
154+
$this->adapter->createSchema('foo');
155+
156+
$options = [
157+
'schema' => 'foo',
158+
'connection' => $this->adapter->getConnection(),
159+
'name' => PGSQL_DB_CONFIG['name'],
160+
];
161+
$adapter = new PostgresAdapter($options, new ArrayInput([]), new NullOutput());
162+
$adapter->connect();
163+
$this->assertTrue($adapter->hasTable('foo.' . $adapter->getSchemaTableName()));
164+
}
165+
151166
public function testCreatingTheSchemaTableOnConnect()
152167
{
153168
$this->adapter->connect();

0 commit comments

Comments
 (0)