for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Db\Tests\Query\Helper;
use PHPUnit\Framework\TestCase;
use Yiisoft\Db\Expression\Expression;
use Yiisoft\Db\Schema\Quoter;
use Yiisoft\Db\Tests\Support\Mock;
final class QueryHelperTest extends TestCase
{
/**
* @dataProvider \Yiisoft\Db\Tests\Query\Helper\QueryHelperProviders::tablesNameDataProvider
*/
public function testCleanUpTableNames(array $tables, string $prefixDatabase, array $expected): void
$prefixDatabase
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function testCleanUpTableNames(array $tables, /** @scrutinizer ignore-unused */ string $prefixDatabase, array $expected): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$this->assertEquals(
$expected,
Mock::queryHelper()->cleanUpTableNames($tables, new Quoter('"', '"'))
);
}
* @dataProvider \Yiisoft\Db\Tests\Query\Helper\QueryHelperProviders::filterConditionDataProvider
public function testFilterCondition(array|string $condition, array|string $expected): void
$this->assertEquals($expected, Mock::queryHelper()->filterCondition($condition));
* @dataProvider \Yiisoft\Db\Tests\Query\Helper\QueryHelperProviders::normalizeOrderByProvider
public function testNormalizeOrderBy(array|string|Expression $columns, array|string $expected): void
$this->assertEquals($expected, Mock::queryHelper()->normalizeOrderBy($columns));
* @dataProvider \Yiisoft\Db\Tests\Query\Helper\QueryHelperProviders::normalizeSelectProvider
public function testNormalizeSelect(array|string|Expression $columns, array|string $expected): void
$this->assertEquals($expected, Mock::queryHelper()->normalizeSelect($columns));
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.