Skip to content

Commit 7792610

Browse files
author
Anna Bukatar
committed
ACP2E-2844: Issues after upgrading MariaDB to 10.5.1 or higher
1 parent dbd1e7a commit 7792610

File tree

1 file changed

+58
-0
lines changed
  • lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo

1 file changed

+58
-0
lines changed

lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,64 @@ public function columnDataForTest(): array
852852
];
853853
}
854854

855+
/**
856+
* @param array $actual
857+
* @param mixed $expected
858+
* @dataProvider columnDataAndValueForTest
859+
* @return void
860+
* @throws \ReflectionException
861+
*/
862+
public function testPrepareColumnValue(array $actual, mixed $expected)
863+
{
864+
$adapter = $this->getMysqlPdoAdapterMock([]);
865+
866+
$result = $this->invokeModelMethod($adapter, 'prepareColumnValue', [$actual[0], $actual[1]]);
867+
868+
$this->assertEquals($expected, $result);
869+
}
870+
871+
/**
872+
* Data provider for testPrepareColumnValue
873+
*
874+
* @return array[]
875+
*/
876+
public function columnDataAndValueForTest(): array
877+
{
878+
return [
879+
[
880+
'actual' => [
881+
[
882+
'DATA_TYPE' => 'int',
883+
'DEFAULT' => ''
884+
],
885+
'10'
886+
],
887+
'expected' => 10
888+
],
889+
[
890+
'actual' => [
891+
[
892+
'DATA_TYPE' => 'timestamp /* mariadb-5.3 */',
893+
'DEFAULT' => 'CURRENT_TIMESTAMP'
894+
],
895+
'null'
896+
],
897+
'expected' => new \Zend_Db_Expr('NULL')
898+
],
899+
[
900+
'actual' => [
901+
[
902+
'DATA_TYPE' => 'varchar',
903+
'NULLABLE' => false,
904+
'DEFAULT' => ''
905+
],
906+
10
907+
],
908+
'expected' => '10'
909+
]
910+
];
911+
}
912+
855913
/**
856914
* @param string $method
857915
* @param array $parameters

0 commit comments

Comments
 (0)