Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json_decode failed with jql search result. #8

Closed
lesstif opened this issue Aug 14, 2015 · 4 comments
Closed

json_decode failed with jql search result. #8

lesstif opened this issue Aug 14, 2015 · 4 comments

Comments

@lesstif
Copy link
Owner

lesstif commented Aug 14, 2015

public function testSearch()
    {
        $jql = 'project not in (TEST)  and assignee = currentUser() and status in (Resolved, closed)';
        try {
            $issueService = new IssueService();

            $ret = $issueService->search($jql);
            var_dump($ret);
        } catch (JIRAException $e) {
            $this->assertTrue(false, 'testSearch Failed : '.$e->getMessage());
        }
    }

Fatal error: Class 'string' not found in D:\github\php-jira-rest-client\vendor\netresearch\jsonmapper\src\JsonMapper.php on line 287

@keanor
Copy link
Contributor

keanor commented Aug 14, 2015

It is strange, maybe this is because of php version? with my configuration (php-fpm 5.5.9-1ubuntu4.11) it works! Try to replace "string[]" in docBlock annotations with "array". This prioblem with JsonMapper or Issue classes annotation

@lesstif
Copy link
Owner Author

lesstif commented Aug 14, 2015

thanks your comment. I'm using php 5.6.8 on Windows & CentOS 7.

would you try this code with master branch and attach result?

<?php

use JiraRestApi\Issue\IssueSearchResult;

class IssueTest extends PHPUnit_Framework_TestCase
{
    public function testMapper()
    {
        $d = file_get_contents('http://pastebin.com/download.php?i=fQ6kf6cC');

        $json_mapper = new \JsonMapper();
        $json_mapper->bExceptionOnUndefinedProperty = true;

        $ret = $json_mapper->map(
            json_decode($d),  new IssueSearchResult()
        );

        var_dump($ret);
    }
}

@keanor
Copy link
Contributor

keanor commented Aug 14, 2015

Yes, bug is reproduced (without $json_mapper->bExceptionOnUndefinedProperty = true).

Today, I find out what the problem is

@keanor
Copy link
Contributor

keanor commented Aug 14, 2015

#9

docTypes problem...

lesstif added a commit that referenced this issue Aug 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants