Exemplo n.º 1
0
 public function testSave()
 {
     $this->resourceMock->expects($this->any())->method('getConnection')->willReturn($this->adapterMock);
     $this->adapterMock->expects($this->any())->method('quoteInto');
     $this->adapterMock->expects($this->any())->method('describeTable')->will($this->returnValue([]));
     $this->adapterMock->expects($this->any())->method('update');
     $this->adapterMock->expects($this->any())->method('lastInsertId');
     $this->addressHandlerMock->expects($this->once())->method('removeEmptyAddresses')->with($this->equalTo($this->orderMock))->will($this->returnSelf());
     $this->stateHandlerMock->expects($this->once())->method('check')->with($this->equalTo($this->orderMock))->will($this->returnSelf());
     $this->orderMock->expects($this->any())->method('getId')->will($this->returnValue(1));
     $this->orderMock->expects($this->once())->method('getRelatedObjects')->willReturn([]);
     $this->resource->save($this->orderMock);
 }