Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ parameters:
path: tests/Component/DataGrid/ColumnTypeExtension/ValueFormatColumnOptionsExtensionTest.php
- message: "#Return type of call to method PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder<Doctrine\\\\ORM\\\\Query>::getMock\\(\\) contains unresolvable type\\.#"
path: tests/Bundle/DataGridBundle/DataGrid/ColumnTypeExtension/FormExtensionTest.php
- message: '#Access to an undefined property Doctrine\\ORM\\Mapping\\ClassMetadata<Tests\\FSi\\Bundle\\DataGridBundle\\Fixtures\\EntityCategory>::\$propertyAccessors\.#'
path: 'tests/Bundle/DataGridBundle/DataGrid/ColumnTypeExtension/FormExtensionTest.php'
- message: '#.*Symfony\\Component\\Routing\\RouteCollectionBuilder.*#'
path: 'tests/Bundle/DataGridBundle/Fixtures/TestKernel.php'
- message: '#.*Symfony\\Component\\Routing\\RouteCollectionBuilder.*#'
Expand Down
3 changes: 2 additions & 1 deletion src/Bundle/DataGridBundle/Twig/Extension/DataGridRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ public function dataGridColumnActionCellActionWidget(
'content' => $content,
'attr' => $urlAttrs,
'translation_domain' => $view->getAttribute('translation_domain'),
'field_mapping_values' => $fieldMappingValues
'field_mapping_values' => $fieldMappingValues,
'vars' => $this->getDataGridVars($dataGridName),
];

return $this->renderTheme($dataGridName, $context, $blockNames);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\FieldMapping;
use Doctrine\ORM\Mapping\PropertyAccessors\PropertyAccessorFactory;
use Doctrine\ORM\Query;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
Expand Down Expand Up @@ -210,9 +211,15 @@ protected function setUp(): void
'id' => $fieldMapping
];
}
$classMetadata->reflFields = [
'id' => new ReflectionProperty($entityClass, 'id'),
];
if (true === class_exists(PropertyAccessorFactory::class)) {
$classMetadata->propertyAccessors = [
'id' => PropertyAccessorFactory::createPropertyAccessor($entityClass, 'id'),
];
} else {
$classMetadata->reflFields = [
'id' => new ReflectionProperty($entityClass, 'id'),
];
}

$repository = $this->getMockBuilder(EntityRepository::class)
->setConstructorArgs([$objectManager, $classMetadata])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ public function testDataGridColumnActionCellActionRenderBlock(): void
'attr' => [],
'translation_domain' => null,
'field_mapping_values' => [],
'global_var' => 'global_value'
'global_var' => 'global_value',
'vars' => [],
])
->willReturn('template');

Expand Down