Ejemplo n.º 1
0
 public function testSetForm()
 {
     $baseUrl = 'base_url';
     $attributeKey = 'attribute_key';
     $attributeValue = 'attribute_value';
     $this->dataForm->expects($this->once())->method('setParent')->with($this->model)->willReturnSelf();
     $this->dataForm->expects($this->once())->method('setBaseUrl')->with($baseUrl)->willReturnSelf();
     $this->dataForm->expects($this->once())->method('addCustomAttribute')->with($attributeKey, $attributeValue)->willReturnSelf();
     $this->urlBuilder->expects($this->once())->method('getBaseUrl')->willReturn($baseUrl);
     $this->model->setData('custom_attributes', [$attributeKey => $attributeValue]);
     $this->assertEquals($this->model, $this->model->setForm($this->dataForm));
 }