diff --git a/lib/Doctrine/ConnectionFactory.php b/lib/Doctrine/ConnectionFactory.php index de2c6ce3fb..a2891c6ced 100644 --- a/lib/Doctrine/ConnectionFactory.php +++ b/lib/Doctrine/ConnectionFactory.php @@ -54,7 +54,7 @@ class ConnectionFactory { '@@session.sql_mode = REPLACE(@@sql_mode, "ONLY_FULL_GROUP_BY", "")', // We need to use CONVERT for MySQL 8, Maria DB bug which triggers #1232 - Incorrect argument type to variable 'wait_timeout` // https://stackoverflow.com/questions/35187378/mariadb-type-error-when-setting-session-variable - "@@session.wait_timeout = GREATEST(CONVERT(COALESCE(@@wait_timeout, 0), SIGNED), $this->min_wait_timeout)", + "@@session.wait_timeout = GREATEST(CONVERT(COALESCE(@@wait_timeout, 0), SIGNED), $this->minWaitTimeout)", ]; if (!empty(Env::$dbCharset)) { diff --git a/tests/integration/Doctrine/EventListeners/TimestampListenerTest.php b/tests/integration/Doctrine/EventListeners/TimestampListenerTest.php index 99b2cb1a6e..fb361fc4be 100644 --- a/tests/integration/Doctrine/EventListeners/TimestampListenerTest.php +++ b/tests/integration/Doctrine/EventListeners/TimestampListenerTest.php @@ -33,9 +33,9 @@ class TimestampListenerTest extends \MailPoetTest { $this->entityManager = $this->createEntityManager(); $this->tableName = $this->entityManager->getClassMetadata(TimestampEntity::class)->getTableName(); - $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->table_name"); + $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->tableName"); $this->connection->executeUpdate(" - CREATE TABLE $this->table_name ( + CREATE TABLE $this->tableName ( id int(11) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, created_at timestamp NULL, updated_at timestamp NULL, @@ -57,7 +57,7 @@ class TimestampListenerTest extends \MailPoetTest { public function testItSetsTimestampOnUpdate() { $this->connection->executeUpdate(" - INSERT INTO $this->table_name (id, created_at, updated_at, name) VALUES ( + INSERT INTO $this->tableName (id, created_at, updated_at, name) VALUES ( 123, '2000-01-01 12:00:00', '2000-01-01 12:00:00', @@ -75,7 +75,7 @@ class TimestampListenerTest extends \MailPoetTest { public function _after() { parent::_after(); - $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->table_name"); + $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->tableName"); } private function createEntityManager() { diff --git a/tests/integration/Doctrine/EventListeners/ValidationTest.php b/tests/integration/Doctrine/EventListeners/ValidationTest.php index 5220bb2545..a9f9d7aee9 100644 --- a/tests/integration/Doctrine/EventListeners/ValidationTest.php +++ b/tests/integration/Doctrine/EventListeners/ValidationTest.php @@ -25,9 +25,9 @@ class ValidationTest extends \MailPoetTest { $this->wp = new WPFunctions(); $this->entityManager = $this->createEntityManager(); $this->tableName = $this->entityManager->getClassMetadata(ValidatedEntity::class)->getTableName(); - $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->table_name"); + $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->tableName"); $this->connection->executeUpdate(" - CREATE TABLE $this->table_name ( + CREATE TABLE $this->tableName ( id int(11) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(255) NOT NULL ) @@ -49,7 +49,7 @@ class ValidationTest extends \MailPoetTest { public function testItValidatesUpdatedEntity() { $id = 1; $name = 'Test name'; - $this->connection->executeUpdate("INSERT INTO $this->table_name (id, name) VALUES (?, ?)", [$id, $name]); + $this->connection->executeUpdate("INSERT INTO $this->tableName (id, name) VALUES (?, ?)", [$id, $name]); /** @var ValidatedEntity $entity */ $entity = $this->entityManager->find(ValidatedEntity::class, $id); diff --git a/tests/integration/Doctrine/Types/JsonTypesTest.php b/tests/integration/Doctrine/Types/JsonTypesTest.php index 334422aa0c..fd614416f6 100644 --- a/tests/integration/Doctrine/Types/JsonTypesTest.php +++ b/tests/integration/Doctrine/Types/JsonTypesTest.php @@ -37,9 +37,9 @@ class JsonTypesTest extends \MailPoetTest { $this->wp = new WPFunctions(); $this->entityManager = $this->createEntityManager(); $this->tableName = $this->entityManager->getClassMetadata(JsonEntity::class)->getTableName(); - $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->table_name"); + $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->tableName"); $this->connection->executeUpdate(" - CREATE TABLE $this->table_name ( + CREATE TABLE $this->tableName ( id int(11) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, json_data longtext NULL, json_or_serialized_data longtext NULL @@ -54,14 +54,14 @@ class JsonTypesTest extends \MailPoetTest { $this->entityManager->persist($entity); $this->entityManager->flush(); - $savedData = $this->connection->executeQuery("SELECT * FROM $this->table_name")->fetch(); + $savedData = $this->connection->executeQuery("SELECT * FROM $this->tableName")->fetch(); expect($savedData['json_data'])->same(json_encode($this->testData)); expect($savedData['json_or_serialized_data'])->same(json_encode($this->testData)); } public function testItLoadsJsonData() { $this->connection->executeUpdate( - "INSERT INTO $this->table_name (id, json_data, json_or_serialized_data) VALUES (?, ?, ?)", + "INSERT INTO $this->tableName (id, json_data, json_or_serialized_data) VALUES (?, ?, ?)", [ 1, json_encode($this->testData), @@ -76,7 +76,7 @@ class JsonTypesTest extends \MailPoetTest { public function testItLoadsSerializedData() { $this->connection->executeUpdate( - "INSERT INTO $this->table_name (id, json_or_serialized_data) VALUES (?, ?)", + "INSERT INTO $this->tableName (id, json_or_serialized_data) VALUES (?, ?)", [ 1, serialize($this->testData), @@ -95,14 +95,14 @@ class JsonTypesTest extends \MailPoetTest { $this->entityManager->persist($entity); $this->entityManager->flush(); - $savedData = $this->connection->executeQuery("SELECT * FROM $this->table_name")->fetch(); + $savedData = $this->connection->executeQuery("SELECT * FROM $this->tableName")->fetch(); expect($savedData['json_data'])->null(); expect($savedData['json_or_serialized_data'])->null(); } public function testItLoadsNullData() { $this->connection->executeUpdate( - "INSERT INTO $this->table_name (id, json_data, json_or_serialized_data) VALUES (?, ?, ?)", + "INSERT INTO $this->tableName (id, json_data, json_or_serialized_data) VALUES (?, ?, ?)", [ 1, null, @@ -117,7 +117,7 @@ class JsonTypesTest extends \MailPoetTest { public function testItLoadsEmptyStringAsNull() { $this->connection->executeUpdate( - "INSERT INTO $this->table_name (id, json_data, json_or_serialized_data) VALUES (?, ?, ?)", + "INSERT INTO $this->tableName (id, json_data, json_or_serialized_data) VALUES (?, ?, ?)", [ 1, '', @@ -146,7 +146,7 @@ class JsonTypesTest extends \MailPoetTest { public function testItDoesNotLoadInvalidData() { $this->connection->executeUpdate( - "INSERT INTO $this->table_name (id, json_data) VALUES (?, ?)", + "INSERT INTO $this->tableName (id, json_data) VALUES (?, ?)", [ 1, '{', // invalid JSON @@ -164,7 +164,7 @@ class JsonTypesTest extends \MailPoetTest { public function _after() { parent::_after(); - $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->table_name"); + $this->connection->executeUpdate("DROP TABLE IF EXISTS $this->tableName"); } private function createEntityManager() {