Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function testSetOrderChannel()
- {
- // Mock tbOrderBackendChannel and SimpleXMLElement
- $orderChannelMock = $this->createMock(tbOrderBackendChannel::class);
- $xmlMock = $this->createMock(SimpleXMLElement::class);
- // Set expectations and assertions for the mocked objects
- $xmlMock->expects($this->once())
- ->method('__get')
- ->with($this->equalTo('IsPrime'))
- ->willReturn('true');
- // Create an instance of tbAmazonSpOrdersService
- $configMock = $this->createMock(tbChannelConfig::class);
- $service = new tbAmazonSpOrdersService($configMock);
- // Call the method to be tested
- $service->setOrderChannel($orderChannelMock, $xmlMock);
- // Assert that the values are correctly set in the order channel
- $this->assertEquals('true', $orderChannelMock->getValueByKey('IsPrime'));
- }
Advertisement
Add Comment
Please, Sign In to add comment