Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gjdanis committed Sep 17, 2020
1 parent 2ebb247 commit 4601eab
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Driver/Mysqli/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class Statement implements StatementInterface
{
/** @var string[] */
protected static $_paramTypeMap = [
ParameterType::ASCII_STRING => 's',
ParameterType::ASCII => 's',
ParameterType::STRING => 's',
ParameterType::BINARY => 's',
ParameterType::BOOLEAN => 'i',
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/SQLSrv/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le

break;

case ParameterType::ASCII_STRING:
case ParameterType::ASCII:
$type = PDO::PARAM_STR;
$length = 0;
$driverOptions = PDO::SQLSRV_ENCODING_SYSTEM;
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class Statement implements StatementInterface
ParameterType::NULL => PDO::PARAM_NULL,
ParameterType::INTEGER => PDO::PARAM_INT,
ParameterType::STRING => PDO::PARAM_STR,
ParameterType::ASCII_STRING => PDO::PARAM_STR,
ParameterType::ASCII => PDO::PARAM_STR,
ParameterType::BINARY => PDO::PARAM_LOB,
ParameterType::LARGE_OBJECT => PDO::PARAM_LOB,
ParameterType::BOOLEAN => PDO::PARAM_BOOL,
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/SQLSrv/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private function prepare()
];
break;

case ParameterType::ASCII_STRING:
case ParameterType::ASCII:
$params[$column - 1] = [
&$variable,
SQLSRV_PARAM_IN,
Expand Down
2 changes: 1 addition & 1 deletion src/ParameterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class ParameterType
/**
* Represents an ascii string data type
*/
public const ASCII_STRING = 17;
public const ASCII = 17;

/**
* This class cannot be instantiated.
Expand Down
2 changes: 1 addition & 1 deletion src/Types/AsciiStringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform)
*/
public function getBindingType()
{
return ParameterType::ASCII_STRING;
return ParameterType::ASCII;
}

public function getName(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Tests\FunctionalTestCase;

class AsciiStringTest extends FunctionalTestCase
class AsciiTest extends FunctionalTestCase
{
public function testAsciiBinding(): void
{
Expand All @@ -18,7 +18,7 @@ public function testAsciiBinding(): void

$statement = $this->connection->prepare('SELECT sql_variant_property(?, \'BaseType\')');

$statement->bindValue(1, 'test', ParameterType::ASCII_STRING);
$statement->bindValue(1, 'test', ParameterType::ASCII);
$results = $statement->execute()->fetchOne();

self::assertEquals('varchar', $results);
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Types/AsciiStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ private function insert(string $id, string $value): void
'id' => $id,
'val' => $value,
], [
ParameterType::ASCII_STRING,
ParameterType::ASCII_STRING,
ParameterType::ASCII,
ParameterType::ASCII,
]);

self::assertSame(1, $result);
Expand All @@ -60,7 +60,7 @@ private function select(string $id): string
$value = $this->connection->fetchOne(
'SELECT val FROM ascii_table WHERE id = ?',
[$id],
[ParameterType::ASCII_STRING]
[ParameterType::ASCII]
);

self::assertIsString($value);
Expand Down
4 changes: 2 additions & 2 deletions tests/Types/AsciiStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function setUp(): void

public function testReturnCorrectBindingType(): void
{
self::assertEquals($this->type->getBindingType(), ParameterType::ASCII_STRING);
self::assertEquals($this->type->getBindingType(), ParameterType::ASCII);
}

public function testDelegateToPlatformForSqlDeclaration(): void
Expand All @@ -34,7 +34,7 @@ public function testDelegateToPlatformForSqlDeclaration(): void
foreach ($columnDefinitions as $column) {
$platform = $this->createMock(AbstractPlatform::class);
$platform->expects(self::once())
->method('getAsciiTypeDeclarationSQL')
->method('getAsciiStringTypeDeclarationSQL')
->with($column);

$this->type->getSQLDeclaration($column, $platform);
Expand Down

0 comments on commit 4601eab

Please sign in to comment.