Skip to content

Commit

Permalink
Merge pull request #893 from goetas/connection
Browse files Browse the repository at this point in the history
Expose the connection in DependencyFactory
  • Loading branch information
goetas authored Dec 15, 2019
2 parents 7ffde26 + 71c27b3 commit e064cec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/Migrations/DependencyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function getConfiguration() : Configuration
return $this->configuration;
}

private function getConnection() : Connection
public function getConnection() : Connection
{
return $this->connection;
}
Expand Down
9 changes: 9 additions & 0 deletions tests/Doctrine/Migrations/Tests/DependencyFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,13 @@ public function testFinder() : void

self::assertInstanceOf(GlobFinder::class, $finder);
}

public function testConnection() : void
{
$conf = new Configuration();
$di = new DependencyFactory($conf, $this->connection);
$conn = $di->getConnection();

self::assertSame($this->connection, $conn);
}
}

0 comments on commit e064cec

Please sign in to comment.