Skip to content

Commit

Permalink
* Removed phpcs dep because of PHP 5.3
Browse files Browse the repository at this point in the history
* Removed @Covers annotation so PHPUnit can decide on it's own.
  • Loading branch information
serbanghita committed Dec 9, 2017
1 parent 5fde8ab commit 24b8cab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 32 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"php": ">=5.0.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8|5.7",
"squizlabs/php_codesniffer": "~2.8|3.*"
"phpunit/phpunit": "~4.8|5.7"
},
"autoload": {
"classmap": ["Mobile_Detect.php"],
Expand Down
33 changes: 3 additions & 30 deletions tests/BasicsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function headersProvider()

/**
* @dataProvider headersProvider
* @covers Mobile_Detect::getHttpHeader
* @param array $headers
*/
public function testConstructorInjection(array $headers)
{
Expand All @@ -126,7 +126,6 @@ public function testConstructorInjection(array $headers)

/**
* @dataProvider headersProvider
* @covers Mobile_Detect::getHttpHeader
*/
public function testInvalidHeader($headers)
{
Expand All @@ -153,8 +152,6 @@ public function userAgentProvider()

/**
* @dataProvider userAgentProvider
* @covers Mobile_Detect::setUserAgent
* @covers Mobile_Detect::getUserAgent
*/
public function testGetUserAgent($headers, $expectedUserAgent)
{
Expand All @@ -165,7 +162,6 @@ public function testGetUserAgent($headers, $expectedUserAgent)

/**
* Headers should be reset when you use setHttpHeaders.
* @covers Mobile_Detect::setHttpHeaders
* @issue #144
*/
public function testSetHttpHeaders()
Expand All @@ -181,7 +177,6 @@ public function testSetHttpHeaders()

/**
* Read response from cloudfront, if the cloudfront headers are detected
* @covers Mobile_Detect::setCfHeaders
*/
public function testSetCfHeaders()
{
Expand Down Expand Up @@ -227,29 +222,19 @@ public function testSetCfHeaders()
$this->assertSame($md->getCfHeaders(), $header4);
}

/**
* @covers Mobile_Detect::setUserAgent
* @covers Mobile_Detect::getUserAgent
*/
public function testSetUserAgent()
{
$md = new Mobile_Detect(array());
$md->setUserAgent('hello world');
$this->assertSame('hello world', $md->getUserAgent());
}

/**
* @covers Mobile_Detect::prepareUserAgent
*/
public function testSetLongUserAgent() {
$md = new Mobile_Detect();
$md->setUserAgent(str_repeat("a", 501));
$this->assertEquals(strlen($md->getUserAgent()), 500);
}

/**
* @covers Mobile_Detect::setDetectionType
*/
public function testSetDetectionType()
{
$md = new Mobile_Detect(array());
Expand Down Expand Up @@ -343,7 +328,7 @@ public function quickHeadersData()

/**
* @dataProvider quickHeadersData
* @covers Mobile_Detect::checkHttpHeadersForMobile
* @param $headers
*/
public function testQuickHeaders($headers)
{
Expand Down Expand Up @@ -377,7 +362,7 @@ public function quickNonMobileHeadersData()

/**
* @dataProvider quickNonMobileHeadersData
* @covers Mobile_Detect::checkHttpHeadersForMobile
* @param $headers
*/
public function testNonMobileQuickHeaders($headers)
{
Expand All @@ -387,7 +372,6 @@ public function testNonMobileQuickHeaders($headers)

/**
* @expectedException BadMethodCallException
* @coversNothing
*/
public function testBadMethodCall()
{
Expand Down Expand Up @@ -439,7 +423,6 @@ public function versionDataProvider()

/**
* @dataProvider versionDataProvider
* @covers Mobile_Detect::version
*/
public function testVersionExtraction($userAgent, $property, $stringVersion, $floatVersion)
{
Expand All @@ -456,9 +439,6 @@ public function testVersionExtraction($userAgent, $property, $stringVersion, $fl
$this->assertFalse($prop);
}

/**
* @covers Mobile_Detect::getMobileDetectionRules
*/
public function testRules()
{
$md = new Mobile_Detect;
Expand All @@ -472,9 +452,6 @@ public function testRules()
$this->assertEquals($count, count($rules));
}

/**
* @covers Mobile_Detect::getMobileDetectionRulesExtended
*/
public function testRulesExtended()
{
$md = new Mobile_Detect;
Expand All @@ -490,9 +467,6 @@ public function testRulesExtended()
$this->assertEquals($count, count($rules));
}

/**
* @covers Mobile_Detect::getScriptVersion
*/
public function testScriptVersion()
{
$v = Mobile_Detect::getScriptVersion();
Expand All @@ -517,7 +491,6 @@ public function crazyVersionNumbers()

/**
* @dataProvider crazyVersionNumbers
* @covers Mobile_Detect::prepareVersionNo
*/
public function testPrepareVersionNo($raw, $expected)
{
Expand Down
6 changes: 6 additions & 0 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@
<directory suffix="Test.php">./</directory>
</testsuite>

<filter>
<whitelist>
<file>../Mobile_Detect.php</file>
</whitelist>
</filter>

</phpunit>

0 comments on commit 24b8cab

Please sign in to comment.