Skip to content

Commit c1f6823

Browse files
committed
Add test for deprecated attachCustomFieldXML method
1 parent 63504c1 commit c1f6823

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Unit/Api/AbstractApiTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,21 @@ public function testDeprecatedRetrieveAll()
236236
$this->assertSame([], $method->invoke($api, '/issues.xml'));
237237

238238
}
239+
240+
/**
241+
* @covers \Redmine\Api\AbstractApi::attachCustomFieldXML
242+
*/
243+
public function testDeprecatedAttachCustomFieldXML()
244+
{
245+
$client = $this->createMock(Client::class);
246+
247+
$api = $this->getMockForAbstractClass(AbstractApi::class, [$client]);
248+
249+
$method = new ReflectionMethod($api, 'attachCustomFieldXML');
250+
$method->setAccessible(true);
251+
252+
$xml = new SimpleXMLElement('<?xml version="1.0"?><issue/>');
253+
254+
$this->assertInstanceOf(SimpleXMLElement::class, $method->invoke($api, $xml, []));
255+
}
239256
}

0 commit comments

Comments
 (0)