Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Sep 15, 2022
1 parent 3348d0a commit 856201d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
2 changes: 2 additions & 0 deletions core-bundle/tests/Contao/DataContainerTest.php
Expand Up @@ -23,8 +23,10 @@ class DataContainerTest extends TestCase
public function testCombiner(array $source, array $expected): void
{
$class = new \ReflectionClass(DC_Table::class);

$method = $class->getMethod('combiner');
$method->setAccessible(true);

$names = $method->invoke($class->newInstanceWithoutConstructor(), $source);

$this->assertSame($expected, array_values($names));
Expand Down
Expand Up @@ -18,7 +18,7 @@
use Contao\Database\Statement;
use Contao\DC_Table;

class DC_TableTest extends TestCase
class DcTableTest extends TestCase
{
/**
* @dataProvider getPalette
Expand All @@ -28,7 +28,6 @@ public function testGetPalette(array $dca, array $row, string $expected): void
$result = new Result([$row], '');

$statement = $this->createMock(Statement::class);

$statement
->method('limit')
->willReturn($statement)
Expand All @@ -52,8 +51,9 @@ public function testGetPalette(array $dca, array $row, string $expected): void
$method->setAccessible(true);
$method->invoke($dataContainer, $database, 'Database');

/** @phpstan-ignore-next-line */
$dataContainer->strTable = 'tl_test';
$table = $reflection->getProperty('strTable');
$table->setAccessible(true);
$table->setValue($dataContainer, 'tl_test');

$GLOBALS['TL_DCA']['tl_test'] = $dca;

Expand All @@ -62,28 +62,26 @@ public function testGetPalette(array $dca, array $row, string $expected): void

public function getPalette(): array
{
return [
return [[
[
[
'palettes' => [
'__selector__' => ['fieldA', 'fieldB', 'fieldC'],
'default' => 'paletteDefault',
'valueA' => 'paletteA',
'valueAvalueC' => 'paletteAC',
],
'fields' => [
'fieldA' => ['inputType' => 'text'],
'fieldB' => ['inputType' => 'text'],
'fieldC' => ['inputType' => 'text'],
],
'palettes' => [
'__selector__' => ['fieldA', 'fieldB', 'fieldC'],
'default' => 'paletteDefault',
'valueA' => 'paletteA',
'valueAvalueC' => 'paletteAC',
],
[
'fieldA' => 'valueA',
'fieldB' => null,
'fieldC' => 'valueC',
'fields' => [
'fieldA' => ['inputType' => 'text'],
'fieldB' => ['inputType' => 'text'],
'fieldC' => ['inputType' => 'text'],
],
'paletteAC',
],
];
[
'fieldA' => 'valueA',
'fieldB' => null,
'fieldC' => 'valueC',
],
'paletteAC',
]];
}
}

0 comments on commit 856201d

Please sign in to comment.