-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from cbschuld/curl_and_wget
adds curl and wget support
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 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
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,32 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
// originally created by - @willemstuursma - https://github.com/willemstuursma | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
require_once dirname(__FILE__)."/TabDelimitedFileIterator.php"; | ||
|
||
final class CurlWgetTest extends TestCase | ||
{ | ||
/** | ||
* @param $user_agent | ||
* @param $expected_browser | ||
* @param $expected_version | ||
* | ||
* @dataProvider dpUserAgents | ||
*/ | ||
public function testBrowserDetectedCorrectly ($user_agent, $expected_browser, $expected_version) | ||
{ | ||
$browser = new Browser($user_agent); | ||
$this->assertEquals($expected_browser, $browser->getBrowser()); | ||
$this->assertEquals($expected_version, $browser->getVersion()); | ||
} | ||
public function dpUserAgents () | ||
{ | ||
return array( | ||
array("curl/7.37.1", Browser::BROWSER_CURL, '7.37.1'), | ||
array("Wget/1.16 (darwin14.0.0)", Browser::BROWSER_WGET, '1.16'), | ||
); | ||
} | ||
} |