Skip to content

Commit

Permalink
Merge pull request #12 from toooni/sf5
Browse files Browse the repository at this point in the history
PHP8 and Symfony 5 support
  • Loading branch information
goetas authored Feb 6, 2021
2 parents 6d5e9a5 + a0db992 commit 61022b9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ php:
- 7.2
- 7.3
- 7.4
- 8.0

matrix:
include:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"email": "goetas@gmail.com"
}],
"require": {
"php": "^7.1",
"php": "^7.1|^8.0",
"goetas-webservices/xsd-reader": "^0.3",
"symfony/event-dispatcher": "^2.4||^3.0||^4.0"
"symfony/event-dispatcher": "^2.4|^3.0|^4.0|^5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0",
"phpunit/phpunit": "^8.0|^9.0",
"jmikola/wildcard-event-dispatcher": "~1.0"
},
"autoload": {
Expand Down
10 changes: 5 additions & 5 deletions tests/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

use GoetasWebservices\XML\WSDLReader\DefinitionsReader;
use GoetasWebservices\XML\WSDLReader\Wsdl\Definitions;
use GoetasWebservices\XML\WSDLReader\Wsdl\TypeNotFoundException;
use GoetasWebservices\XML\XSDReader\Schema\Element\ElementDef;
use GoetasWebservices\XML\XSDReader\Schema\Type\ComplexType;
use PHPUnit\Framework\TestCase;

class BaseTest extends \PHPUnit_Framework_TestCase
class BaseTest extends TestCase
{

/**
Expand All @@ -15,7 +17,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
*/
protected $reader;

public function setUp()
public function setUp(): void
{
$this->reader = new DefinitionsReader();
}
Expand Down Expand Up @@ -73,11 +75,9 @@ public function testImport()
$this->assertNotNull($definitions->findService('StockQuote', 'http://www.example.com'));
}

/**
* @expectedException \Exception
*/
public function testTypeNotFound()
{
$this->expectException(TypeNotFoundException::class);
$definitions = $this->reader->readFile(__DIR__ . '/resources/base-wsdl-import.wsdl');
$this->assertNotNull($definitions->findBinding('StockQuoteSoap2', 'http://www.example.com'));
}
Expand Down
7 changes: 4 additions & 3 deletions tests/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

use GoetasWebservices\XML\WSDLReader\DefinitionsReader;
use Jmikola\WildcardEventDispatcher\WildcardEventDispatcher;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\Event;

class EventsTest extends \PHPUnit_Framework_TestCase
class EventsTest extends TestCase
{

/**
Expand All @@ -20,7 +21,7 @@ class EventsTest extends \PHPUnit_Framework_TestCase
*/
protected $dispatcher;

public function setUp()
public function setUp(): void
{
$this->dispatcher = new WildcardEventDispatcher();
$this->reader = new DefinitionsReader(null, $this->dispatcher);
Expand Down Expand Up @@ -73,7 +74,7 @@ public function testReadFile()
$this->assertCount(count($expected), $events);

foreach ($expected as $index => $expectedData) {
list($event, $name) = $events[$index];
[$event, $name] = $events[$index];
$this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $event);
$this->assertInstanceOf('GoetasWebservices\XML\WSDLReader\Events\WsdlEvent', $event);
$this->assertInstanceOf($expectedData[1], $event, "Event name '$expectedData[0]'");
Expand Down

0 comments on commit 61022b9

Please sign in to comment.