コード例 #1
0
 /**
  * Run test getConfig method
  *
  * @param array $config
  * @param array $expected
  * @dataProvider getConfigDataProvider
  */
 public function testGetConfig($config, $expected)
 {
     $this->braintreeAdapter->expects(static::once())->method('generate')->willReturn(self::CLIENT_TOKEN);
     foreach ($config as $method => $value) {
         $this->config->expects(static::once())->method($method)->willReturn($value);
     }
     $this->payPalConfig->expects(static::once())->method('isActive')->willReturn(true);
     $this->payPalConfig->expects(static::once())->method('isAllowToEditShippingAddress')->willReturn(true);
     $this->payPalConfig->expects(static::once())->method('getMerchantName')->willReturn('Test');
     $this->payPalConfig->expects(static::once())->method('getTitle')->willReturn('Payment Title');
     $this->localeResolver->expects(static::once())->method('getLocale')->willReturn('en_US');
     static::assertEquals($expected, $this->configProvider->getConfig());
 }