/** * @param string $countryCode * @param string $xml * @param string $expected * @dataProvider dataProviderReadOtherCountryConfig */ public function testReadOtherCountryConfig($countryCode, $xml, $expected) { $this->helper->expects($this->once())->method('getConfigurationCountryCode')->willReturn($countryCode); $this->fileResolver->expects($this->at(0))->method('get')->willReturn([]); $this->fileResolver->expects($this->at(1))->method('get')->with($this->equalTo($expected))->willReturn($xml); $this->reader = new Reader($this->fileResolver, $this->converter, $this->schemaLocator, $this->validationState, $this->helper); $this->reader->read(); }
/** * Getting data for generating rules (JSON) * * @return string */ public function getJson() { return json_encode($this->rulesReader->read()); }
/** * Run test for getJson method * * @return void */ public function testGetJson() { $expected = ['test' => 'test-value']; $this->readerMock->expects($this->once())->method('read')->willReturn($expected); $this->assertEquals(json_encode($expected), $this->resolutionRules->getJson()); }
/** * Run test for getJson method * * @param array $incoming * @param string $outgoing * @dataProvider getJsonDataProvider */ public function testGetJson($incoming, $outgoing) { $this->readerMock->expects($this->once())->method('read')->willReturn($incoming); $this->assertEquals($outgoing, $this->resolutionRules->getJson()); }
/** * Getting data for generating rules (JSON) * * @return string */ public function getJson() { return json_encode($this->rulesReader->read(), JSON_FORCE_OBJECT); }