Skip to content

Commit

Permalink
Add test for Project::prepareParamsXml()
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Sep 27, 2023
1 parent c1f6823 commit bcabc70
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/Unit/Api/ProjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use Redmine\Api\Project;
use Redmine\Client\Client;
use Redmine\Exception\MissingParameterException;
use ReflectionMethod;
use SimpleXMLElement;

/**
* @coversDefaultClass \Redmine\Api\Project
Expand Down Expand Up @@ -534,4 +536,19 @@ public function testUpdateCallsPut()
// Perform the tests
$this->assertSame($response, $api->update(5, $parameters));
}

/**
* @covers \Redmine\Api\Project::prepareParamsXml
*/
public function testDeprecatedPrepareParamsXml()
{
$client = $this->createMock(Client::class);

$api = new Project($client);

$method = new ReflectionMethod($api, 'prepareParamsXml');
$method->setAccessible(true);

$this->assertInstanceOf(SimpleXMLElement::class, $method->invoke($api, ['id' => 1]));
}
}

0 comments on commit bcabc70

Please sign in to comment.