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

Fix the ini_parse_quantity() polyfill #442

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
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: 12 additions & 14 deletions src/Php82/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@
return;
}

if (!extension_loaded('odbc')) {
return;
}

if (!function_exists('odbc_connection_string_is_quoted')) {
function odbc_connection_string_is_quoted(string $str): bool { return p\Php82::odbc_connection_string_is_quoted($str); }
}

if (!function_exists('odbc_connection_string_should_quote')) {
function odbc_connection_string_should_quote(string $str): bool { return p\Php82::odbc_connection_string_should_quote($str); }
}

if (!function_exists('odbc_connection_string_quote')) {
function odbc_connection_string_quote(string $str): string { return p\Php82::odbc_connection_string_quote($str); }
if (extension_loaded('odbc')) {
if (!function_exists('odbc_connection_string_is_quoted')) {
function odbc_connection_string_is_quoted(string $str): bool { return p\Php82::odbc_connection_string_is_quoted($str); }
}

if (!function_exists('odbc_connection_string_should_quote')) {
function odbc_connection_string_should_quote(string $str): bool { return p\Php82::odbc_connection_string_should_quote($str); }
}

if (!function_exists('odbc_connection_string_quote')) {
function odbc_connection_string_quote(string $str): string { return p\Php82::odbc_connection_string_quote($str); }
}
}

if (!function_exists('ini_parse_quantity')) {
Expand Down
6 changes: 3 additions & 3 deletions tests/Php82/Php82Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@

use PHPUnit\Framework\TestCase;

/**
* @requires extension odbc
*/
class Php82Test extends TestCase
{
/**
* @dataProvider provideConnectionStringValuesFromUpstream
* @dataProvider provideMoreConnectionStringValues
* @requires extension odbc
*/
public function testConnectionStringIsQuoted(string $value, bool $isQuoted)
{
Expand All @@ -30,6 +28,7 @@ public function testConnectionStringIsQuoted(string $value, bool $isQuoted)
/**
* @dataProvider provideConnectionStringValuesFromUpstream
* @dataProvider provideMoreConnectionStringValues
* @requires extension odbc
*/
public function testConnectionStringShouldQuote(string $value, bool $isQuoted, bool $shouldQuote)
{
Expand All @@ -39,6 +38,7 @@ public function testConnectionStringShouldQuote(string $value, bool $isQuoted, b
/**
* @dataProvider provideConnectionStringValuesFromUpstream
* @dataProvider provideMoreConnectionStringValues
* @requires extension odbc
*/
public function testConnectionStringQuote(string $value, bool $isQuoted, bool $shouldQuote, string $quoted)
{
Expand Down
Loading