function let(ArrayToDefinitionConverterInterface $converter, Grid $firstGrid, Grid $secondGrid, Grid $thirdGrid) { $converter->convert('sylius_admin_tax_category', ['configuration1'])->willReturn($firstGrid); $converter->convert('sylius_admin_product', ['configuration2'])->willReturn($secondGrid); $converter->convert('sylius_admin_order', ['configuration3'])->willReturn($thirdGrid); $this->beConstructedWith($converter, ['sylius_admin_tax_category' => ['configuration1'], 'sylius_admin_product' => ['configuration2'], 'sylius_admin_order' => ['configuration3']]); }
/** * @param ArrayToDefinitionConverterInterface $converter * @param array $gridConfigurations */ public function __construct(ArrayToDefinitionConverterInterface $converter, array $gridConfigurations) { foreach ($gridConfigurations as $code => $gridConfiguration) { if (isset($gridConfiguration['extends']) && isset($gridConfigurations[$gridConfiguration['extends']])) { $gridConfiguration = $this->extend($gridConfiguration, $gridConfigurations[$gridConfiguration['extends']]); } $this->grids[$code] = $converter->convert($code, $gridConfiguration); } }
/** * @param ArrayToDefinitionConverterInterface $converter * @param array $gridConfigurations */ public function __construct(ArrayToDefinitionConverterInterface $converter, array $gridConfigurations) { foreach ($gridConfigurations as $code => $gridConfiguration) { $this->grids[$code] = $converter->convert($code, $gridConfiguration); } }