Skip to content

Commit

Permalink
Merge pull request #31 from php-vcr/fix-soap-extend-replacement
Browse files Browse the repository at this point in the history
Fix soap extend replacement
  • Loading branch information
adri committed Jan 19, 2014
2 parents a68b0f6 + 2725d16 commit 5c98bad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/VCR/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Configuration
'post_fields' => array('VCR\RequestMatcher', 'matchPostFields'),
);
private $whiteList = array();
private $blackList = array('src/VCR/LibraryHooks/');
private $blackList = array('src/VCR/LibraryHooks/', 'src/VCR/Util/Soap/SoapClient');

/**
*
Expand Down
2 changes: 1 addition & 1 deletion src/VCR/LibraryHooks/Soap/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Filter extends AbstractFilter

private static $patterns = array(
'@new\s+\\\?SoapClient\W*\(@i',
'@extends\s+SoapClient\W*@i',
'@extends\s+\\\?SoapClient@i',
);

/**
Expand Down
8 changes: 8 additions & 0 deletions tests/VCR/LibraryHooks/Soap/FilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ public function codeSnippetProvider()
'new \VCR\Util\Soap\SoapClient(',
'new SoapClient('
),
'extends \SoapClient' => array(
'extends \VCR\Util\Soap\SoapClient',
'extends \SoapClient'
),
'extends \SoapClient with linebreak' => array(
"extends \VCR\Util\Soap\SoapClient\n",
"extends \SoapClient\n"
),
'new SoapClientExtended' => array(
'new SoapClientExtended(',
'new SoapClientExtended('
Expand Down

0 comments on commit 5c98bad

Please sign in to comment.