forked from phpro/soap-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
252 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
language: php | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
matrix: | ||
include: | ||
- php: 5.5 | ||
- php: 5.5 | ||
env: DEPENDENCIES='low' | ||
- php: 5.6 | ||
- php: 5.6 | ||
env: DEPENDENCIES='low' | ||
- php: 7.0 | ||
- php: hhvm | ||
fast_finish: true | ||
|
||
before_install: | ||
- composer selfupdate | ||
- composer global require hirak/prestissimo | ||
|
||
install: | ||
- if [ "$DEPENDENCIES" != "low" ]; then travis_retry composer update --no-progress --profile --prefer-dist --no-scripts --no-interaction; fi; | ||
- if [ "$DEPENDENCIES" == "low" ]; then travis_retry composer update --no-progress --profile --prefer-lowest --no-scripts --no-interaction; fi; | ||
|
||
script: | ||
- ./bin/grumphp run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ protected function getDefaultCommands() | |
|
||
return $commands; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
|
||
class RunTimeException extends \RuntimeException | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,4 +73,4 @@ public static function getSubscribedEvents() | |
Events::FAULT => 'onClientFault' | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ public function convertXmlToPhp($xml); | |
* @return string | ||
*/ | ||
public function convertPhpToXml($php); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,4 @@ interface ResultProviderInterface | |
* @return ResultInterface | ||
*/ | ||
public function getResult(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
namespace Phpro\SoapClient\Util; | ||
|
||
use Phpro\SoapClient\Exception\InvalidArgumentException; | ||
|
||
/** | ||
|
4 changes: 2 additions & 2 deletions
4
...roTest/SoapClient/Soap/SoapClientTest.php → ...lient/Integration/Soap/SoapClientTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
test/PhproTest/SoapClient/Unit/CodeGenerator/PatcherTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?php | ||
|
||
namespace PhproTest\SoapClient\Unit\CodeGenerator; | ||
|
||
use Phpro\SoapClient\CodeGenerator\Patcher; | ||
use Phpro\SoapClient\Util\Filesystem; | ||
|
||
/** | ||
* Class PatcherTest | ||
* | ||
* @package PhproTest\SoapClient\Unit\CodeGenerator | ||
*/ | ||
class PatcherTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
||
/** | ||
* @var Patcher | ||
*/ | ||
private $patcher; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private $createdFiles = array(); | ||
|
||
protected function setUp() | ||
{ | ||
$this->patcher = new Patcher(new Filesystem()); | ||
} | ||
|
||
protected function tearDown() | ||
{ | ||
foreach ($this->createdFiles as $file) { | ||
if (file_exists($file)) { | ||
unlink($file); | ||
} | ||
|
||
if (file_exists($file . '.rej')) { | ||
unlink($file . '.rej'); | ||
} | ||
} | ||
} | ||
|
||
private function loadFixture($file) | ||
{ | ||
if (!file_exists($filePath = FIXTURE_DIR . '/code-generator/' . $file)) { | ||
throw new \RuntimeException('Could not load fixture file: ' . $filePath); | ||
}; | ||
|
||
return file_get_contents($filePath); | ||
} | ||
|
||
/** | ||
* @dataProvider patchDataProvider | ||
* @test | ||
*/ | ||
function it_should_patch_an_existing_file($originalContent, $newContent, $patchedContent) | ||
{ | ||
$originalFile = $this->createdFiles[] = tempnam(sys_get_temp_dir(), 'patchtest'); | ||
$backupFile = $originalFile . '.backup'; | ||
|
||
file_put_contents($originalFile, $originalContent); | ||
$this->patcher->patch($originalFile, $newContent); | ||
|
||
$this->assertStringEqualsFile( | ||
$originalFile, | ||
$patchedContent, | ||
sprintf('Invalid patched content in original file %s!', $originalFile) | ||
); | ||
|
||
if ($originalContent !== $newContent) { | ||
$this->assertStringEqualsFile( | ||
$backupFile, | ||
$originalContent, | ||
sprintf('Invalid backup file %s!', $backupFile) | ||
); | ||
} | ||
} | ||
|
||
function patchDataProvider() | ||
{ | ||
return array( | ||
array( | ||
$this->loadFixture('class-default.php'), | ||
$this->loadFixture('class-default.php'), | ||
$this->loadFixture('class-default.php'), | ||
), | ||
array( | ||
$this->loadFixture('class-default.php'), | ||
$this->loadFixture('soap-newfield.php'), | ||
$this->loadFixture('soap-newfield.php'), | ||
), | ||
array( | ||
$this->loadFixture('class-default.php'), | ||
$this->loadFixture('soap-removedfield.php'), | ||
$this->loadFixture('soap-removedfield.php'), | ||
), | ||
array( | ||
$this->loadFixture('class-tampered.php'), | ||
$this->loadFixture('soap-removedfield.php'), | ||
$this->loadFixture('patched-tampered-removedfield.php'), | ||
), | ||
array( | ||
$this->loadFixture('class-tampered.php'), | ||
$this->loadFixture('soap-removedfield.php'), | ||
$this->loadFixture('patched-tampered-removedfield.php'), | ||
), | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace MyNamespace; | ||
|
||
class MyService | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $myField; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace MyNamespace; | ||
|
||
class MyService | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $myField; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getMyField() | ||
{ | ||
return $this->myField; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
test/fixtures/code-generator/patched-tampered-newfield.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace MyNamespace; | ||
|
||
class MyService | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $myField; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $newField; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getMyField() | ||
{ | ||
return $this->myField; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
test/fixtures/code-generator/patched-tampered-removedfield.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace MyNamespace; | ||
|
||
class MyService | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getMyField() | ||
{ | ||
return $this->myField; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace MyNamespace; | ||
|
||
class MyService | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $myField; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $newField; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace MyNamespace; | ||
|
||
class MyService | ||
{ | ||
} |
File renamed without changes.