Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
96 changes: 96 additions & 0 deletions tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php

declare(strict_types=1);

namespace Tests\MartinGeorgiev\Doctrine\DBAL\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use MartinGeorgiev\Doctrine\DBAL\Types\BaseType;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class BaseTypeTest extends TestCase
{
/**
* @var AbstractPlatform&MockObject
*/
private AbstractPlatform $platform;

protected function setUp(): void
{
$this->platform = $this->createMock(AbstractPlatform::class);
}

/**
* @test
*/
public function throws_exception_when_type_name_not_configured(): void
{
$type = new class extends BaseType {
protected const TYPE_NAME = '';
};

$this->expectException(\LogicException::class);
$this->expectExceptionMessage('no meaningful value for TYPE_NAME constant');

$type->getName();
}

/**
* @test
*/
public function throws_exception_when_getting_sql_declaration_with_no_type_name(): void
{
$type = new class extends BaseType {
protected const TYPE_NAME = '';
};

$this->expectException(\LogicException::class);
$this->expectExceptionMessage('Doctrine type defined in class');

$type->getSQLDeclaration([], $this->platform);
}

/**
* @test
*/
public function returns_correct_type_name(): void
{
$type = new class extends BaseType {
protected const TYPE_NAME = 'custom_type';
};

self::assertEquals('custom_type', $type->getName());
}

/**
* @test
*/
public function gets_correct_sql_declaration(): void
{
$type = new class extends BaseType {
protected const TYPE_NAME = 'custom_type';
};

$this->platform
->expects(self::once())
->method('getDoctrineTypeMapping')
->with('custom_type')
->willReturn('CUSTOM_SQL_TYPE');

$result = $type->getSQLDeclaration([], $this->platform);
self::assertEquals('CUSTOM_SQL_TYPE', $result);
}

/**
* @test
*/
public function requires_sql_comment_hint_returns_false(): void
{
$type = new class extends BaseType {
protected const TYPE_NAME = 'custom_type';
};

self::assertFalse($type->requiresSQLCommentHint($this->platform));

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.

Check failure on line 94 in tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Call to deprecated method requiresSQLCommentHint() of class MartinGeorgiev\Doctrine\DBAL\Types\BaseType.
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php

declare(strict_types=1);

namespace Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;

use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\SqlWalker;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction;
use PHPUnit\Framework\TestCase;

class BaseFunctionTest extends TestCase
{
/**
* @test
*/
public function get_sql_returns_formatted_function_call(): void
{
$function = new class('test_function') extends BaseFunction {
public function __construct(string $name)

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 20 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:19::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().
{
parent::__construct($name);
$this->customizeFunction();
}

protected function customizeFunction(): void
{
$this->setFunctionPrototype('TEST(%s, %s)');
}

/**
* @param list<Node|null> $nodes
*/
public function setNodes(array $nodes): void
{
$this->nodes = $nodes;
}
};

$node1 = $this->createMock(Node::class);
$node1->expects($this->once())
->method('dispatch')
->willReturn('arg1');

$node2 = $this->createMock(Node::class);
$node2->expects($this->once())
->method('dispatch')
->willReturn('arg2');

/** @var list<Node|null> $nodes */
$nodes = [$node1, $node2];
$function->setNodes($nodes);

$sqlWalker = $this->createMock(SqlWalker::class);

$result = $function->getSql($sqlWalker);
$this->assertEquals('TEST(arg1, arg2)', $result);
}

/**
* @test
*/
public function get_sql_handles_null_nodes(): void
{
$function = new class('test_function') extends BaseFunction {
public function __construct(string $name)

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().

Check failure on line 66 in tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $name (string) of method MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction@anonymous/tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunctionTest.php:65::__construct() is not contravariant with parameter #1 $name (mixed) of method Doctrine\ORM\Query\AST\Functions\FunctionNode::__construct().
{
parent::__construct($name);
$this->customizeFunction();
}

protected function customizeFunction(): void
{
$this->setFunctionPrototype('TEST(%s)');
}

/**
* @param list<Node|null> $nodes
*/
public function setNodes(array $nodes): void
{
$this->nodes = $nodes;
}
};

/** @var list<Node|null> $nodes */
$nodes = [null];
$function->setNodes($nodes);

$sqlWalker = $this->createMock(SqlWalker::class);

$result = $function->getSql($sqlWalker);
$this->assertEquals('TEST(null)', $result);
}
}
Loading