Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marked connection exception test incomplete on MySQL 8 #3662

Merged
merged 1 commit into from
Aug 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
namespace Doctrine\Tests\DBAL\Functional;

use Doctrine\DBAL\Driver\ExceptionConverterDriver;
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\DrizzlePlatform;
use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table;
use Doctrine\Tests\DbalFunctionalTestCase;
use Throwable;
use const PHP_OS;
use function array_merge;
use function assert;
use function chmod;
use function exec;
use function file_exists;
Expand All @@ -20,6 +26,7 @@
use function sys_get_temp_dir;
use function touch;
use function unlink;
use function version_compare;

class ExceptionTest extends DbalFunctionalTestCase
{
Expand Down Expand Up @@ -289,7 +296,7 @@ public function testSyntaxErrorException() : void

public function testConnectionExceptionSqLite() : void
{
if ($this->connection->getDatabasePlatform()->getName() !== 'sqlite') {
if ($this->connection instanceof SqlitePlatform) {
$this->markTestSkipped('Only fails this way on sqlite');
}

Expand Down Expand Up @@ -343,18 +350,29 @@ public function testConnectionExceptionSqLite() : void
*/
public function testConnectionException(array $params) : void
{
if ($this->connection->getDatabasePlatform()->getName() === 'sqlite') {
$platform = $this->connection->getDatabasePlatform();

if ($platform instanceof SqlitePlatform) {
$this->markTestSkipped('Only skipped if platform is not sqlite');
}

if ($this->connection->getDatabasePlatform()->getName() === 'drizzle') {
if ($platform instanceof DrizzlePlatform) {
$this->markTestSkipped('Drizzle does not always support authentication');
}

if ($this->connection->getDatabasePlatform()->getName() === 'postgresql' && isset($params['password'])) {
if ($platform instanceof PostgreSqlPlatform && isset($params['password'])) {
$this->markTestSkipped('Does not work on Travis');
}

if ($platform instanceof MySqlPlatform && isset($params['user'])) {
$wrappedConnection = $this->connection->getWrappedConnection();
assert($wrappedConnection instanceof ServerInfoAwareConnection);

if (version_compare($wrappedConnection->getServerVersion(), '8', '>=')) {
$this->markTestIncomplete('PHP currently does not completely support MySQL 8');
}
}

$defaultParams = $this->connection->getParams();
$params = array_merge($defaultParams, $params);

Expand Down