Skip to content

Commit f48bdc9

Browse files
authored
Merge pull request #74 from cbschuld/unit-testing-better-docs
added unit testing, added better docs
2 parents 19878d6 + 43ef289 commit f48bdc9

15 files changed

+5633
-85
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea
2-
vendor
2+
vendor
3+
.phpunit.result.cache
4+
/phpunit.xml

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ dist: precise
55
php:
66
- 7.3
77
- 7.2
8-
- 5.6
9-
- 5.5
10-
- 5.4
8+
9+
install: composer install
1110

1211
script: phpunit --configuration phpunit.xml.dist
12+

CHANGELOG.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project **attempts** to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) while applying
6+
changes when it socially makes sense.
7+
8+
## [Unreleased]
9+
10+
## [1.9.2] - 2019-06-26
11+
### Added
12+
- PHPUnit Tests for Firefox, Opera and Chrome (3684 tests, 7368 assertions)
13+
- Stronger tests for Firefox and Chrome
14+
### Removed
15+
- Dropped support for 5.x PHP due to updates to PHPUnit and legacy nature of 5.X
16+
17+
## [1.9.1] - 2019-06-19
18+
### Added
19+
6/19/2019: Update (Version 1.9.1)
20+
* Added Firefox iOS (gejobj)
21+
* Corrected 'Vivalidi' to 'Vivaldi' (adaxi)
22+
* Reset enhancement (yahasana)
23+
* Enforce using precise distribution until End Of Life for Travis CI (bburnichon)
24+
* Lazy load browser class on demand (bburnichon)
25+
26+
## 1.9.0 - 2010-08-20
27+
### Added
28+
* Added MSN Explorer Browser
29+
* Added Bing/MSN Robot
30+
* Added the Android Platform
31+
### Fixed
32+
* Fixed issue with Android 1.6/2.2
33+
34+
## 1.8.0 - 2010-04-27
35+
## Fixed
36+
* Added iPad support
37+
38+
## 1.7.0 - 2010-03-07
39+
### Added
40+
* Added FreeBSD Platform
41+
* Added OpenBSD Platform
42+
* Added NetBSD Platform
43+
* Added SunOS Platform
44+
* Added OpenSolaris Platform
45+
* Added support of the Iceweazel Browser
46+
* Added isChromeFrame() call to check if chromeframe is in use
47+
* Moved the Opera check in front of the Firefox check due to legacy Opera User Agents
48+
* Added the __toString() method (Thanks Deano)
49+
## Removed
50+
* Almost all of Gary's original code has been replaced
51+
## Fixed
52+
* Version 1.7 was a *MAJOR* Rebuild (preg_match and other *slow* routine removal(s)) included the following
53+
54+
## 0.0.9 - 2008-12-09
55+
### Fixed
56+
* removed an unused constant and renamed the constructor to use the PHP magic method __construct (thanks to Robin for locating the legacy constant and suggesting the use of the magic method).
57+
58+
## 0.0.8 - 2009-11-08
59+
### Fixed
60+
* A lot of changes to the script, thank you to everyone for the suggestions and emails. This release should add all of the requested features. Added BlackBerry, mobile detection, Opera Mini support, robot detection, Opera 10's UserAgent mess, detection for IceCat and Shiretoko!
61+
62+
## 0.0.7 - 2009-04-27
63+
### Fixed
64+
* John pointed out a terrible typo (see below) - removed the typo
65+
66+
## 0.0.6 - 2009-04-22
67+
### Added
68+
* added support for GoogleBot, the W3C Validator and Yahoo! Slurp
69+
70+
## 0.0.5 - 2009-03-14
71+
### Added
72+
* added support for the iPod; added iPod and iPhone as platforms; added Google.s Android
73+
74+
## 0.0.4 - 2009-02-24
75+
### Fixed
76+
* fixed typo in the usage! (thanks Adam!)
77+
78+
## 0.0.3 - 2009-02-19
79+
### Fixed
80+
* updated typical usage to show a correct example! (thanks David!)
81+

README.md

-50
Original file line numberDiff line numberDiff line change
@@ -104,53 +104,3 @@ if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion()
104104
}
105105
```
106106

107-
12/9/2008 Update
108-
* removed an unused constant and renamed the constructor to use the PHP magic method __construct (thanks to Robin for locating the legacy constant and suggesting the use of the magic method).
109-
110-
2/19/2009 Update
111-
* updated typical usage to show a correct example! (thanks David!)
112-
113-
2/24/2009 Update
114-
* fixed typo in the usage! (thanks Adam!)
115-
116-
3/14/2009 Update
117-
* added support for the iPod; added iPod and iPhone as platforms; added Google.s Android
118-
119-
4/22/2009 Update
120-
* added support for GoogleBot, the W3C Validator and Yahoo! Slurp
121-
122-
4/27/2009 Update
123-
* John pointed out a terrible typo (see below) . removed the typo
124-
125-
11/08/2009 Update
126-
* A lot of changes to the script, thank you to everyone for the suggestions and emails. This release should add all of the requested features. Added BlackBerry, mobile detection, Opera Mini support, robot detection, Opera 10.s UserAgent .mess., detection for IceCat and Shiretoko!
127-
128-
3/7/2010 Update
129-
* Version 1.7 was a *MAJOR* Rebuild (preg_match and other .slow. routine removal(s)) included the following changes:
130-
* Almost allof Gary.s original code has been replaced
131-
* Large PHPUNIT testing environment created to validate new releases and additions
132-
* Added FreeBSD Platform
133-
* Added OpenBSD Platform
134-
* Added NetBSD Platform
135-
* Added SunOS Platform
136-
* Added OpenSolaris Platform
137-
* Added support of the Iceweazel Browser
138-
* Added isChromeFrame() call to check if chromeframe is in use
139-
* Moved the Opera check in front of the Firefox check due to legacy Opera User Agents
140-
* Added the __toString() method (Thanks Deano)
141-
142-
4/27/2010: Update (Version 1.8)
143-
* Added iPad support
144-
145-
8/20/2010: Update (Version 1.9)
146-
* Added MSN Explorer Browser
147-
* Added Bing/MSN Robot
148-
* Added the Android Platform
149-
* Fixed issue with Android 1.6/2.2
150-
151-
6/19/2019: Update (Version 1.9.1)
152-
* Added Firefox iOS (gejobj)
153-
* Corrected 'Vivalidi' to 'Vivaldi' (adaxi)
154-
* Reset enhancement (yahasana)
155-
* Enforce using precise distribution until End Of Life for Travis CI (bburnichon)
156-
* Lazy load browser class on demand (bburnichon)

composer.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"name": "cbschuld/browser.php",
33
"description": "A PHP Class to detect a user's Browser",
4-
"keywords": ["browser", "user agent", "detection"],
5-
"homepage": "http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php.html",
4+
"keywords": [
5+
"browser",
6+
"user agent",
7+
"detection"
8+
],
9+
"homepage": "https://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/",
610
"license": "MIT",
711
"authors": [
812
{
@@ -14,9 +18,15 @@
1418
"autoload": {
1519
"classmap": ["lib/Browser.php"]
1620
},
21+
"require": {
22+
"php": ">=7.2"
23+
},
1724
"extra": {
1825
"branch-alias": {
1926
"dev-master": "1.9.x-dev"
2027
}
28+
},
29+
"require-dev": {
30+
"phpunit/phpunit": "^8"
2131
}
22-
}
32+
}

0 commit comments

Comments
 (0)