createMock(Context::class); $this->configMock = $this->createMock(Config::class); $quoteMock = $this->getMockBuilder(Quote::class) ->disableOriginalConstructor() ->setMethods(['getStoreId']) ->getMock(); $quoteMock->method('getStoreId') ->willReturn('123'); $paymentConfig = $this->createMock(PaymentConfig::class); $this->block = new Form( $contextMock, $paymentConfig, $this->configMock, $quoteMock ); } public function testIsCvvEnabled() { $this->configMock->method('isCvvEnabled') ->with('123') ->willReturn(true); $this->assertTrue($this->block->isCvvEnabled()); } }