sebastianbergmann/phpunit-mock-objects

getMockFromWsdl ParseError: syntax error, unexpected '.', expecting '{'

ostrolucky opened this issue · 4 comments

$ ./phpunit.phar src/AppBundle/Tests/DataProvider/JobBoard/BugTest.php 
PHPUnit 6.0.9 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 925 ms, Memory: 6.00MB

There was 1 error:

1) BugTest::testWsdlBug
ParseError: syntax error, unexpected '.', expecting '{'

/var/www/src/AppBundle/Tests/DataProvider/JobBoard/BugTest.php:9

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

Reproducible example:

use PHPUnit\Framework\TestCase;

class BugTest extends TestCase
{
    public function testWsdlBug()
    {
        $this->getMockFromWsdl('https://soapapi.findapprenticeship.service.gov.uk/Services/VacancyManagement/VacancyManagement51.svc?singleWsdl');
    }
}

I can reproduce this.

However, when I download https://soapapi.findapprenticeship.service.gov.uk/Services/VacancyManagement/VacancyManagement51.svc?singleWsdl to VacancyManagement51.wsdl and use that local file then it works.

Looks like an issue with the SOAP extension to me.

It might be, but non-mocked usage of SoapClient for that url works

I do not know what I am supposed to do here, sorry.

Closing unresolved valid issues without confirmation if it's not a bug in your code is certainly one thing you should NOT do.