Skip to content

Commit 5a04ad9

Browse files
committed
fixed tests, changed user agent
1 parent a805bff commit 5a04ad9

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

demo/index.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,13 @@ function printCode($code, $asHtml = true)
292292
<table>
293293
<?php foreach ($info->getDispatcher()->getAllResponses() as $response): ?>
294294
<tr>
295-
<th><?= $response->getUrl() ?></th>
295+
<th>
296+
<?php if ((string) $response->getStartingUrl() !== (string) $response->getUrl()): ?>
297+
<?= $response->getStartingUrl() ?> <code>=&gt;</code>
298+
<?php endif ?>
299+
300+
<?= $response->getUrl() ?>
301+
</th>
296302
</tr>
297303
<tr>
298304
<td><?php printHeaders($response->getHeaders()); ?></td>

src/Http/CurlDispatcher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CurlDispatcher implements DispatcherInterface
2121
CURLOPT_ENCODING => '',
2222
CURLOPT_AUTOREFERER => true,
2323
CURLOPT_FOLLOWLOCATION => true,
24-
CURLOPT_USERAGENT => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:50.0) Gecko/20100101 Firefox/50.0',
24+
CURLOPT_USERAGENT => 'Mozilla/5.0',
2525
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
2626
];
2727

src/Http/Response.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getHtmlContent()
4242
{
4343
if ($this->htmlContent === null) {
4444
try {
45-
if (($content = $this->content) === '') {
45+
if (empty($content = $this->content)) {
4646
return $this->htmlContent = false;
4747
}
4848

src/Providers/Api/GoogleMaps.php

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public function getTitle()
5050
}
5151
}
5252

53+
/**
54+
* {@inheritdoc}
55+
*/
56+
public function getProviderName()
57+
{
58+
return 'Google Maps';
59+
}
60+
5361
/**
5462
* {@inheritdoc}
5563
*/

tests/GoogleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testPlus()
3434
$this->assertEmbed(
3535
'https://plus.google.com/u/0/+StephanHovnanian/posts/6apV9FHgo4k',
3636
[
37-
'title' => 'Grow your business through email marketing Learn more',
37+
'title' => 'Grow your business through email marketing Learn more here: http://bit.ly/Yr...',
3838
'type' => 'rich',
3939
'code' => '<script src="https://apis.google.com/js/plusone.js" type="text/javascript"></script><div class="g-post" data-href="https://plus.google.com/+StephanHovnanian/posts/6apV9FHgo4k"></div>',
4040
'providerName' => 'Google Plus',

0 commit comments

Comments
 (0)