Skip to content

Commit bcabc70

Browse files
committed
Add test for Project::prepareParamsXml()
1 parent c1f6823 commit bcabc70

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Unit/Api/ProjectTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
use Redmine\Api\Project;
77
use Redmine\Client\Client;
88
use Redmine\Exception\MissingParameterException;
9+
use ReflectionMethod;
10+
use SimpleXMLElement;
911

1012
/**
1113
* @coversDefaultClass \Redmine\Api\Project
@@ -534,4 +536,19 @@ public function testUpdateCallsPut()
534536
// Perform the tests
535537
$this->assertSame($response, $api->update(5, $parameters));
536538
}
539+
540+
/**
541+
* @covers \Redmine\Api\Project::prepareParamsXml
542+
*/
543+
public function testDeprecatedPrepareParamsXml()
544+
{
545+
$client = $this->createMock(Client::class);
546+
547+
$api = new Project($client);
548+
549+
$method = new ReflectionMethod($api, 'prepareParamsXml');
550+
$method->setAccessible(true);
551+
552+
$this->assertInstanceOf(SimpleXMLElement::class, $method->invoke($api, ['id' => 1]));
553+
}
537554
}

0 commit comments

Comments
 (0)