Skip to content

Commit

Permalink
CI for 2.x compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
x86demon committed Apr 24, 2024
1 parent 80747e1 commit c0d8e54
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 51 deletions.
23 changes: 2 additions & 21 deletions src/Oro/ORM/Query/AST/FunctionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

namespace Oro\ORM\Query\AST;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\ORM\Query\QueryException;
use Oro\ORM\Query\AST\Platform\Functions\PlatformFunctionNode;

Expand All @@ -16,24 +13,8 @@ class FunctionFactory
*
* @throws QueryException
*/
public static function create(
AbstractPlatform $platform,
string $functionName,
array $parameters
): PlatformFunctionNode {
if ($platform instanceof PostgreSQLPlatform) {
$platformName = 'postgresql';
} elseif ($platform instanceof MySQLPlatform) {
$platformName = 'mysql';
} else {
throw QueryException::syntaxError(
\sprintf(
'Not supported platform "%s"',
$platform::class
)
);
}

public static function create(string $platformName, string $functionName, array $parameters): PlatformFunctionNode
{
$className = __NAMESPACE__
. '\\Platform\\Functions\\'
. static::classify(\strtolower($platformName))
Expand Down
40 changes: 25 additions & 15 deletions tests/config/mysql.phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="false" stopOnFailure="false" bootstrap="../bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<php>
<var name="db_type" value="pdo_mysql"/>
<var name="db_host" value="127.0.0.1"/>
<var name="db_username" value="u_doctrine_extensions"/>
<var name="db_password" value="myPassword"/>
<var name="db_name" value="doctrine_extensions_tests"/>
<var name="db_port" value="3306"/>
</php>
<testsuites>
<testsuite name="Oro Doctrine Extensions Test Suite">
<directory>../Oro/Tests/ORM</directory>
<directory>../Oro/Tests/DBAL</directory>
</testsuite>
</testsuites>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false"
bootstrap="../bootstrap.php"
>
<php>
<var name="db_type" value="pdo_mysql"/>
<var name="db_host" value="127.0.0.1" />
<var name="db_username" value="u_doctrine_extensions" />
<var name="db_password" value="myPassword" />
<var name="db_name" value="doctrine_extensions_tests" />
<var name="db_port" value="3306"/>
</php>

<testsuites>
<testsuite name="Oro Doctrine Extensions Test Suite">
<directory>../Oro/Tests/ORM</directory>
<directory>../Oro/Tests/DBAL</directory>
</testsuite>
</testsuites>
</phpunit>
40 changes: 25 additions & 15 deletions tests/config/pgsql.phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="false" stopOnFailure="false" bootstrap="../bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<php>
<var name="db_type" value="pdo_pgsql"/>
<var name="db_host" value="localhost"/>
<var name="db_username" value="u_doctrine_extensions"/>
<var name="db_password" value="myPassword"/>
<var name="db_name" value="doctrine_extensions_tests"/>
<var name="db_port" value="5432"/>
</php>
<testsuites>
<testsuite name="Oro Doctrine Extensions Test Suite">
<directory>../Oro/Tests/ORM</directory>
<directory>../Oro/Tests/DBAL</directory>
</testsuite>
</testsuites>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false"
bootstrap="../bootstrap.php"
>
<php>
<var name="db_type" value="pdo_pgsql"/>
<var name="db_host" value="localhost" />
<var name="db_username" value="u_doctrine_extensions" />
<var name="db_password" value="myPassword" />
<var name="db_name" value="doctrine_extensions_tests" />
<var name="db_port" value="5432"/>
</php>

<testsuites>
<testsuite name="Oro Doctrine Extensions Test Suite">
<directory>../Oro/Tests/ORM</directory>
<directory>../Oro/Tests/DBAL</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit c0d8e54

Please sign in to comment.