Exemplo n.º 1
0
 public function testGetMethodInstanceRequestedMethod()
 {
     $code = 'real_method';
     $this->info->setData('method', $code);
     $this->paymentHelperMock->expects($this->once())->method('getMethodInstance')->with($code)->willReturn($this->methodInstanceMock);
     $this->methodInstanceMock->expects($this->once())->method('setInfoInstance')->with($this->info);
     $this->assertSame($this->methodInstanceMock, $this->info->getMethodInstance());
     // as the method is already stored at Info, check that it's not initialized again
     $this->assertSame($this->methodInstanceMock, $this->info->getMethodInstance());
 }