mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-16 14:39:37 +00:00
Ran rector and made tests final
This commit is contained in:
parent
43d72faf48
commit
b21d294cf8
162 changed files with 407 additions and 393 deletions
|
|
@ -27,7 +27,7 @@ use App\DataTables\Filters\FilterInterface;
|
|||
use Doctrine\ORM\QueryBuilder;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CompoundFilterTraitTest extends TestCase
|
||||
final class CompoundFilterTraitTest extends TestCase
|
||||
{
|
||||
|
||||
public function testFindAllChildFiltersEmpty(): void
|
||||
|
|
@ -49,9 +49,9 @@ class CompoundFilterTraitTest extends TestCase
|
|||
|
||||
public function testFindAllChildFilters(): void
|
||||
{
|
||||
$f1 = $this->createMock(FilterInterface::class);
|
||||
$f2 = $this->createMock(FilterInterface::class);
|
||||
$f3 = $this->createMock(FilterInterface::class);
|
||||
$f1 = $this->createStub(FilterInterface::class);
|
||||
$f2 = $this->createStub(FilterInterface::class);
|
||||
$f3 = $this->createStub(FilterInterface::class);
|
||||
|
||||
$filter = new class($f1, $f2, $f3, null) {
|
||||
use CompoundFilterTrait;
|
||||
|
|
@ -108,7 +108,7 @@ class CompoundFilterTraitTest extends TestCase
|
|||
}
|
||||
};
|
||||
|
||||
$qb = $this->createMock(QueryBuilder::class);
|
||||
$qb = $this->createStub(QueryBuilder::class);
|
||||
$filter->_applyAllChildFilters($qb);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
|||
use App\DataTables\Filters\Constraints\FilterTrait;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FilterTraitTest extends TestCase
|
||||
final class FilterTraitTest extends TestCase
|
||||
{
|
||||
use FilterTrait;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||
use Doctrine\ORM\QueryBuilder;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class BulkImportJobStatusConstraintTest extends TestCase
|
||||
final class BulkImportJobStatusConstraintTest extends TestCase
|
||||
{
|
||||
private BulkImportJobStatusConstraint $constraint;
|
||||
private QueryBuilder $queryBuilder;
|
||||
|
|
@ -46,7 +46,7 @@ class BulkImportJobStatusConstraintTest extends TestCase
|
|||
|
||||
public function testConstructor(): void
|
||||
{
|
||||
$this->assertEquals([], $this->constraint->getValue());
|
||||
$this->assertSame([], $this->constraint->getValue());
|
||||
$this->assertEmpty($this->constraint->getOperator());
|
||||
$this->assertFalse($this->constraint->isEnabled());
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ class BulkImportJobStatusConstraintTest extends TestCase
|
|||
$values = ['pending', 'in_progress'];
|
||||
$this->constraint->setValue($values);
|
||||
|
||||
$this->assertEquals($values, $this->constraint->getValue());
|
||||
$this->assertSame($values, $this->constraint->getValue());
|
||||
}
|
||||
|
||||
public function testGetAndSetOperator(): void
|
||||
|
|
@ -64,7 +64,7 @@ class BulkImportJobStatusConstraintTest extends TestCase
|
|||
$operator = 'ANY';
|
||||
$this->constraint->setOperator($operator);
|
||||
|
||||
$this->assertEquals($operator, $this->constraint->getOperator());
|
||||
$this->assertSame($operator, $this->constraint->getOperator());
|
||||
}
|
||||
|
||||
public function testIsEnabledWithEmptyValues(): void
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||
use Doctrine\ORM\QueryBuilder;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class BulkImportPartStatusConstraintTest extends TestCase
|
||||
final class BulkImportPartStatusConstraintTest extends TestCase
|
||||
{
|
||||
private BulkImportPartStatusConstraint $constraint;
|
||||
private QueryBuilder $queryBuilder;
|
||||
|
|
@ -46,7 +46,7 @@ class BulkImportPartStatusConstraintTest extends TestCase
|
|||
|
||||
public function testConstructor(): void
|
||||
{
|
||||
$this->assertEquals([], $this->constraint->getValue());
|
||||
$this->assertSame([], $this->constraint->getValue());
|
||||
$this->assertEmpty($this->constraint->getOperator());
|
||||
$this->assertFalse($this->constraint->isEnabled());
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ class BulkImportPartStatusConstraintTest extends TestCase
|
|||
$values = ['pending', 'completed', 'skipped'];
|
||||
$this->constraint->setValue($values);
|
||||
|
||||
$this->assertEquals($values, $this->constraint->getValue());
|
||||
$this->assertSame($values, $this->constraint->getValue());
|
||||
}
|
||||
|
||||
public function testGetAndSetOperator(): void
|
||||
|
|
@ -64,7 +64,7 @@ class BulkImportPartStatusConstraintTest extends TestCase
|
|||
$operator = 'ANY';
|
||||
$this->constraint->setOperator($operator);
|
||||
|
||||
$this->assertEquals($operator, $this->constraint->getOperator());
|
||||
$this->assertSame($operator, $this->constraint->getOperator());
|
||||
}
|
||||
|
||||
public function testIsEnabledWithEmptyValues(): void
|
||||
|
|
@ -294,6 +294,6 @@ class BulkImportPartStatusConstraintTest extends TestCase
|
|||
|
||||
$this->constraint->apply($this->queryBuilder);
|
||||
|
||||
$this->assertEquals($statusValues, $this->constraint->getValue());
|
||||
$this->assertSame($statusValues, $this->constraint->getValue());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue