Skip to content

Commit a7ea350

Browse files
committed
issue #7 - remove useless double backslash, customize test for php 7
1 parent 81e1e8f commit a7ea350

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ php:
77
- 5.4
88
- 5.5
99
- 5.6
10-
- 7
10+
- 7.0
11+
- 7.1
1112

1213
before_install:
1314
- composer self-update
1415

1516
install:
16-
- composer install --no-dev
17+
- composer install
1718

1819
script:
19-
- phpunit --coverage-text --coverage-clover=coverage.clover
20+
- ./vendor/phpunit/phpunit/phpunit --coverage-text --coverage-clover=coverage.clover
2021

2122
after_script:
2223
- wget https://scrutinizer-ci.com/ocular.phar
23-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
24+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"php" : ">=5.3.3"
2020
},
2121
"require-dev": {
22-
"fabpot/php-cs-fixer": "~1.8"
22+
"fabpot/php-cs-fixer": "~1.8",
23+
"phpunit": "~4.0"
2324
},
2425
"autoload": {
2526
"psr-4": {

tests/SoapClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class SoapClient extends AbstractSoapClientBase
88
{
99
public function getSoapClientClassName($soapClientClassName = null)
1010
{
11-
return parent::getSoapClientClassName(empty($soapClientClassName) ? '\\WsdlToPhp\\PackageBase\\Tests\\Client' : $soapClientClassName);
11+
return parent::getSoapClientClassName(empty($soapClientClassName) ? '\WsdlToPhp\PackageBase\Tests\Client' : $soapClientClassName);
1212
}
1313
/**
1414
* @return Client

tests/SoapClientTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function testSoapClientName()
1515
{
1616
$soapClient = new SoapClient();
1717

18-
$this->assertSame('\\WsdlToPhp\\PackageBase\\Tests\\Client', $soapClient->getSoapClientClassName());
18+
$this->assertSame('\WsdlToPhp\PackageBase\Tests\Client', $soapClient->getSoapClientClassName());
1919
}
2020
/**
2121
*
@@ -24,7 +24,7 @@ public function testSoapClientNameDefault()
2424
{
2525
$soapClient = new SoapClient();
2626

27-
$this->assertSame('\SoapClient', $soapClient->getSoapClientClassName('\\WsdlToPhp\\PackageBase\\Tests\\Clien'));
27+
$this->assertSame('\SoapClient', $soapClient->getSoapClientClassName('\WsdlToPhp\PackageBase\Tests\Clien'));
2828
}
2929
/**
3030
*
@@ -36,7 +36,7 @@ public function testSoapClient()
3636
SoapClient::WSDL_CLASSMAP => self::classMap(),
3737
));
3838

39-
$this->assertInstanceOf('\\WsdlToPhp\\PackageBase\\Tests\\Client', $soapClient->getSoapClient());
39+
$this->assertInstanceOf('\WsdlToPhp\PackageBase\Tests\Client', $soapClient->getSoapClient());
4040
}
4141
/**
4242
*
@@ -74,7 +74,7 @@ public function testGetLastRequestAsDomDocument()
7474
SoapClient::WSDL_CLASSMAP => self::classMap(),
7575
));
7676

77-
$this->assertInstanceOf('\\DOMDocument', $soapClient->getLastRequest(true));
77+
$this->assertInstanceOf('\DOMDocument', $soapClient->getLastRequest(true));
7878
}
7979
/**
8080
*
@@ -98,7 +98,7 @@ public function testGetLastResponseAsDomDocument()
9898
SoapClient::WSDL_CLASSMAP => self::classMap(),
9999
));
100100

101-
$this->assertInstanceOf('\\DOMDocument', $soapClient->getLastResponse(true));
101+
$this->assertInstanceOf('\DOMDocument', $soapClient->getLastResponse(true));
102102
}
103103
/**
104104
*
@@ -161,7 +161,7 @@ public function testSetGetLastErrorForMethod()
161161
// this call should fail as no parameter is defined in the request
162162
$soapClient->search();
163163

164-
$this->assertInstanceOf('\\SoapFault', $soapClient->getLastErrorForMethod('WsdlToPhp\PackageBase\Tests\SoapClient::search'));
164+
$this->assertInstanceOf('\SoapFault', $soapClient->getLastErrorForMethod('WsdlToPhp\PackageBase\Tests\SoapClient::search'));
165165
}
166166
/**
167167
*
@@ -333,7 +333,11 @@ public function testGetStreamContextAsNill()
333333
SoapClient::WSDL_CLASSMAP => self::classMap(),
334334
));
335335

336-
$this->assertNull($soapClient->getStreamContext());
336+
if (PHP_VERSION_ID < 70013) {
337+
$this->assertNull($soapClient->getStreamContext());
338+
} else {
339+
$this->assertTrue(is_resource($soapClient->getStreamContext()));
340+
}
337341
}
338342
/**
339343
*

tests/UtilsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ public function testGetFormatedXmlInvalidXmlAsDomDocument()
4646
*/
4747
public function testGetDOMDocument()
4848
{
49-
$this->assertInstanceOf('\\DOMDocument', Utils::getDOMDocument(file_get_contents(__DIR__ . '/resources/oneline.xml')));
49+
$this->assertInstanceOf('\DOMDocument', Utils::getDOMDocument(file_get_contents(__DIR__ . '/resources/oneline.xml')));
5050
}
5151
/**
5252
* @expectedException \InvalidArgumentException
5353
*/
5454
public function testGetDOMDocumentException()
5555
{
56-
$this->assertInstanceOf('\\DOMDocument', Utils::getDOMDocument(''));
56+
$this->assertInstanceOf('\DOMDocument', Utils::getDOMDocument(''));
5757
}
5858
}

0 commit comments

Comments
 (0)