Skip to content

Commit

Permalink
Fix: rename UserAgent edge to msedge (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbinjanssen authored Apr 13, 2022
1 parent 987b51e commit 1895571
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Faker/Provider/UserAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class UserAgent extends Base
{
protected static $userAgents = ['firefox', 'chrome', 'internetExplorer', 'opera', 'safari', 'edge'];
protected static $userAgents = ['firefox', 'chrome', 'internetExplorer', 'opera', 'safari', 'msedge'];

protected static $windowsPlatformTokens = [
'Windows NT 6.2', 'Windows NT 6.1', 'Windows NT 6.0', 'Windows NT 5.2', 'Windows NT 5.1',
Expand Down
12 changes: 12 additions & 0 deletions test/Faker/Provider/UserAgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
*/
final class UserAgentTest extends TestCase
{
public function testAllAgents()
{
$agent = new UserAgent($this->faker);
$reflection = new \ReflectionClass($agent);
$agents = $reflection->getProperty('userAgents');
$agents->setAccessible(true);

foreach ($agents->getValue() as $method) {
self::assertNotNull(UserAgent::$method());
}
}

public function testRandomUserAgent()
{
self::assertNotNull(UserAgent::userAgent());
Expand Down

0 comments on commit 1895571

Please sign in to comment.