Skip to content

Commit fdcdbfc

Browse files
committed
resolved merge conflicts
2 parents 7cecd4b + 044aa84 commit fdcdbfc

File tree

11 files changed

+77
-59
lines changed

11 files changed

+77
-59
lines changed

Readme.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,35 @@ cd php-vcr-examples/
1111
composer install
1212
```
1313

14-
## Guzzle
14+
## Guzzle (using curl_runkit library hook)
1515

1616
To run the guzzle example, do this:
1717

1818
```
1919
cd guzzle
20-
../vendor/bin/phpunit .
20+
../vendor/bin/phpunit
2121
```
2222

2323
If you like to record all http requests again, delete the fixture file.
2424

2525
```
2626
rm test/fixtures/github_adri_php-vcr.yml
27-
../vendor/bin/phpunit .
27+
../vendor/bin/phpunit
28+
```
29+
30+
## Soap
31+
32+
Soap examples can be run by:
33+
34+
```
35+
cd soap
36+
../vendor/bin/phpunit
37+
```
38+
39+
To record all http requests agian, delete the fixtures:
40+
41+
```
42+
cd soap
43+
rm test/fixtures/soap_weather_api_temperature
44+
../vendor/bin/phpunit
2845
```

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
},
1818

1919
"autoload": {
20-
"classmap": ["guzzle/src/Adri", "soap/src/Adri"]
20+
"classmap": [
21+
"guzzle/src/VCR",
22+
"soap/src/VCR"
23+
]
2124
}
2225
}

composer.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

guzzle/phpunit.xml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
<phpunit
2-
cacheTokens="true"
3-
colors="true"
4-
bootstrap="test/bootstrap.php"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
forceCoversAnnotation="false"
9-
mapTestClassNameToCoveredClassName="false"
10-
printerClass="PHPUnit_TextUI_ResultPrinter"
11-
processIsolation="false"
12-
stopOnError="false"
13-
stopOnFailure="false"
14-
stopOnIncomplete="false"
15-
stopOnSkipped="false"
16-
testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
17-
strict="false"
18-
debug="true"
19-
verbose="true">
2+
bootstrap="test/bootstrap.php"
3+
convertErrorsToExceptions="true"
4+
convertNoticesToExceptions="true"
5+
convertWarningsToExceptions="true"
6+
stopOnError="false"
7+
stopOnFailure="false"
8+
stopOnIncomplete="false"
9+
stopOnSkipped="false"
10+
strict="true"
11+
>
2012

2113
<testsuites>
22-
<directory>./test</directory>>
14+
<testsuite>
15+
<directory>./test</directory>>
16+
</testsuite>
2317
</testsuites>
2418

2519
<listeners>
26-
<listener class="PHPUnit_Util_Log_VCR" file="../vendor/adri/phpunit-testlistener-vcr/PHPUnit/Util/Log/VCR.php" />
20+
<listener class="PHPUnit_Util_Log_VCR" file="../vendor/php-vcr/phpunit-testlistener-vcr/PHPUnit/Util/Log/VCR.php" />
2721
</listeners>
2822

2923
</phpunit>

guzzle/src/Adri/GithubProjectGuzzle.php renamed to guzzle/src/VCR/Example/GithubProjectGuzzle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Adri;
3+
namespace VCR\Example;
44

55
use Guzzle\Http\Client;
66
use Guzzle\Http\Exception\ClientErrorResponseException;

guzzle/test/Adri/GithubProjectGuzzleTest.php renamed to guzzle/test/VCR/Example/GithubProjectGuzzleTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22

3-
namespace Adri;
3+
namespace VCR\Example;
44

55
use Guzzle\Http\Client;
66
use Guzzle\Http\Exception\ClientErrorResponseException;
7+
78
/**
89
* Tests Guzzle class.
910
*/
@@ -15,12 +16,12 @@ class GithubProjectGuzzleTest extends \PHPUnit_Framework_TestCase
1516
*/
1617
public function testGithubInfoForExistingProject()
1718
{
18-
$githubProject = new GithubProjectGuzzle('adri/php-vcr');
19+
$githubProject = new GithubProjectGuzzle('php-vcr/php-vcr');
1920
$info = $githubProject->getInfo();
2021

2122
$this->assertTrue(is_array($info), 'Response is not an array.');
2223
$this->assertArrayHasKey('full_name', $info, "Key 'full_name' not found.");
23-
$this->assertEquals('adri/php-vcr', $info['full_name'], "Value for key 'full_name' wrong.");
24+
$this->assertEquals('php-vcr/php-vcr', $info['full_name'], "Value for key 'full_name' wrong.");
2425
$this->assertArrayHasKey('private', $info, "Key 'private' not found.");
2526
$this->assertFalse($info['private'], "Key 'private' is not false.");
2627
}
@@ -30,7 +31,7 @@ public function testGithubInfoForExistingProject()
3031
*/
3132
public function testGithubInfoForNonExistingProject()
3233
{
33-
$githubProject = new GithubProjectGuzzle('adri/random_stuff');
34+
$githubProject = new GithubProjectGuzzle('php-vcr/random_stuff');
3435
$info = $githubProject->getInfo();
3536

3637
$this->assertNull($info, 'Response is not null.');

guzzle/test/bootstrap.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
<?php
22

3+
if (!file_exists(__DIR__ . "/../../vendor/autoload.php")) {
4+
die(
5+
"\n[ERROR] You need to run composer before running the test suite.\n".
6+
"To do so run the following commands:\n".
7+
" curl -s http://getcomposer.org/installer | php\n".
8+
" php composer.phar install\n\n"
9+
);
10+
}
11+
12+
require_once __DIR__ . '/../../vendor/autoload.php';
13+
314
\VCR\VCR::configure()->setCassettePath('test/fixtures');

soap/phpunit.xml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
<phpunit
2-
cacheTokens="true"
3-
colors="true"
4-
bootstrap="test/bootstrap.php"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
forceCoversAnnotation="false"
9-
mapTestClassNameToCoveredClassName="false"
10-
printerClass="PHPUnit_TextUI_ResultPrinter"
11-
processIsolation="false"
12-
stopOnError="false"
13-
stopOnFailure="false"
14-
stopOnIncomplete="false"
15-
stopOnSkipped="false"
16-
testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
17-
strict="false"
18-
debug="true"
19-
verbose="true">
2+
bootstrap="test/bootstrap.php"
3+
convertErrorsToExceptions="true"
4+
convertNoticesToExceptions="true"
5+
convertWarningsToExceptions="true"
6+
stopOnError="false"
7+
stopOnFailure="false"
8+
stopOnIncomplete="false"
9+
stopOnSkipped="false"
10+
strict="true"
11+
>
2012

2113
<testsuites>
2214
<testsuite>
@@ -25,7 +17,7 @@
2517
</testsuites>
2618

2719
<listeners>
28-
<listener class="PHPUnit_Util_Log_VCR" file="../vendor/adri/phpunit-testlistener-vcr/PHPUnit/Util/Log/VCR.php" />
20+
<listener class="PHPUnit_Util_Log_VCR" file="../vendor/php-vcr/phpunit-testlistener-vcr/PHPUnit/Util/Log/VCR.php" />
2921
</listeners>
3022

3123
</phpunit>

soap/src/Adri/WeatherApi.php renamed to soap/src/VCR/WeatherApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Adri;
3+
namespace VCR;
44

55
/**
66
* Checks cdyne.com for local weather information.

soap/test/Adri/WeatherApiTest.php renamed to soap/test/VCR/WeatherApiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Adri;
3+
namespace VCR;
44

55
/**
66
* Checks cdyne.com for local weather information.

0 commit comments

Comments
 (0)