Beispiel #1
0
 public function testPrepareDataSource()
 {
     $item = ['test_data' => 'some_data', 'field_name' => self::TEST_TIME];
     $dateTime = new \DateTime(self::TEST_TIME);
     $this->timezoneMock->expects($this->once())->method('date')->willReturn($dateTime);
     $result = $this->model->prepareDataSource(['data' => ['items' => [$item]]]);
     $this->assertEquals(self::TEST_TIME, $result['data']['items'][0]['field_name']);
 }
 /**
  * @param ContextInterface $context
  * @param UiComponentFactory $uiComponentFactory
  * @param TimezoneInterface $timezone
  * @param \ShipperHQ\Shipper\Helper\CarrierGroup $carrierGroupHelper
  * @param array $components
  * @param array $data
  */
 public function __construct(ContextInterface $context, UiComponentFactory $uiComponentFactory, TimezoneInterface $timezone, \ShipperHQ\Shipper\Helper\CarrierGroup $carrierGroupHelper, array $components = [], array $data = [])
 {
     $this->carrierGroupHelper = $carrierGroupHelper;
     parent::__construct($context, $uiComponentFactory, $timezone, $components, $data);
 }