Skip to content

Commit

Permalink
Merge pull request #117 from peter279k/test_enhancement
Browse files Browse the repository at this point in the history
Test enhancement
  • Loading branch information
jenssegers committed Apr 3, 2018
2 parents df71082 + 6493c2e commit bd62821
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
8 changes: 7 additions & 1 deletion phpunit.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
Expand All @@ -16,4 +16,10 @@
<exclude>tests/VendorsTest.php</exclude>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="false">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
16 changes: 16 additions & 0 deletions tests/AgentTest.php
Expand Up @@ -155,6 +155,22 @@ public function testRobots()
}
}

public function testRobotShouldReturnFalse()
{
$agent = new Agent;

$this->assertFalse($agent->robot());
}

/**
* @expectedException BadMethodCallException
*/
public function testCallShouldThrowBadMethodCallException()
{
$agent = new Agent;
$agent->invalidMethod();
}

public function testMobileDevices()
{
$agent = new Agent;
Expand Down
2 changes: 1 addition & 1 deletion tests/BasicTest.php
@@ -1,6 +1,6 @@
<?php

require 'vendor/mobiledetect/mobiledetectlib/tests/BasicsTest.php';
require __DIR__ . '/../vendor/mobiledetect/mobiledetectlib/tests/BasicsTest.php';

use Jenssegers\Agent\Agent;

Expand Down
2 changes: 1 addition & 1 deletion tests/UserAgentTest.php
@@ -1,6 +1,6 @@
<?php

require 'vendor/mobiledetect/mobiledetectlib/tests/UserAgentTest.php';
require __DIR__ . '/../vendor/mobiledetect/mobiledetectlib/tests/UserAgentTest.php';

use Jenssegers\Agent\Agent;

Expand Down
2 changes: 1 addition & 1 deletion tests/VendorsTest.php
@@ -1,6 +1,6 @@
<?php

require 'vendor/mobiledetect/mobiledetectlib/tests/VendorsTest_tmp.php';
require __DIR__ . '/../vendor/mobiledetect/mobiledetectlib/tests/UserAgentTest.php';

use Jenssegers\Agent\Agent;

Expand Down
11 changes: 0 additions & 11 deletions tests/bootstrap.php

This file was deleted.

0 comments on commit bd62821

Please sign in to comment.