Esempio n. 1
0
 public function testUpdateActionSuccess()
 {
     $content = '{"packages":[{"name":"vendor\\/package","version":"1.0"}],"type":"update",' . '"headerTitle": "Update package 1" }';
     $this->request->expects($this->any())->method('getContent')->willReturn($content);
     $this->payloadValidator->expects($this->once())->method('validatePayload')->willReturn('');
     $this->updaterTaskCreator->expects($this->once())->method('createUpdaterTasks')->willReturn('');
     $this->controller->setEvent($this->mvcEvent);
     $this->controller->dispatch($this->request, $this->response);
     $this->controller->updateAction();
 }
 public function testUpdateActionSuccessDisable()
 {
     $content = '{"packages":[{"name":"vendor\\/package"}],"type":"disable",' . '"headerTitle": "Disable Package 1" }';
     $this->request->expects($this->any())->method('getContent')->willReturn($content);
     $this->fullModuleList->expects($this->once())->method('has')->willReturn(true);
     $write = $this->getMockForAbstractClass('Magento\\Framework\\Filesystem\\Directory\\WriteInterface', [], '', false);
     $this->filesystem->expects($this->once())->method('getDirectoryWrite')->willReturn($write);
     $write->expects($this->once())->method('writeFile')->with('.type.json', '{"type":"disable","headerTitle":"Disable Package 1","titles":["D"]}');
     $this->controller->setEvent($this->mvcEvent);
     $this->controller->dispatch($this->request, $this->response);
     $this->controller->updateAction();
 }