Ejemplo n.º 1
0
 public function testPrepareDataSource()
 {
     $dataSource = ['data' => ['items' => [['entity_id' => 1]]]];
     $expectedDataSource = ['data' => ['items' => [['entity_id' => 1, 'name' => ['edit' => ['href' => 'http://magento.com/customer/index/edit', 'label' => new \Magento\Framework\Phrase('Edit'), 'hidden' => false]]]]]];
     $this->context->expects($this->once())->method('getFilterParam')->with('store_id')->willReturn(null);
     $this->urlBuilder->expects($this->once())->method('getUrl')->with('customer/*/edit', ['id' => 1, 'store' => null])->willReturn('http://magento.com/customer/index/edit');
     $dataSource = $this->component->prepareDataSource($dataSource);
     $this->assertEquals($expectedDataSource, $dataSource);
 }