Skip to content

Commit fea1ec2

Browse files
committed
add serialized data test case
1 parent cb0c797 commit fea1ec2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ before_install:
1212
- travis_retry composer install --no-interaction --prefer-dist
1313
script:
1414
- phpunit --verbose tests/MockTest
15+
- phpunit --verbose tests/SerializeTest
1516

1617
matrix:
1718
allow_failures:

tests/SerializeTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use JiraRestApi\Issue\IssueService;
4+
use JiraRestApi\Issue\IssueField;
5+
use JiraRestApi\Issue\Comment;
6+
use JiraRestApi\Issue\Reporter;
7+
use JiraRestApi\Issue\Transition;
8+
9+
class SerializeTest extends PHPUnit_Framework_TestCase
10+
{
11+
/**
12+
* @see https://github.com/lesstif/php-jira-rest-client/issues/18
13+
*/
14+
public function testEmptyAssignee()
15+
{
16+
$r = new Reporter();
17+
18+
$r->name = '';
19+
$r->emailAddress = '[email protected]';
20+
$r->avatarUrls = '';
21+
22+
$d = $r->jsonSerialize();
23+
24+
// passing a name value of '' then serialized array has 'name' key and empty value.
25+
$this->assertEquals(true, array_key_exists('name', $d), 'Can\'t found "name" key.');
26+
$this->assertEquals(false, array_key_exists('avatarUrls', $d));
27+
}
28+
}

0 commit comments

Comments
 (0)