This repository was archived by the owner on Jul 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +68
-1
lines changed
tests/UAParser/Tests/Result Expand file tree Collapse file tree 3 files changed +68
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,6 @@ public function toString()
2323 /** @return string */
2424 protected function formatVersion ()
2525 {
26- return join ('. ' , array_filter (func_get_args ()));
26+ return join ('. ' , array_filter (func_get_args (), ' is_numeric ' ));
2727 }
2828}
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * ua-parser
4+ *
5+ * Copyright (c) 2011-2012 Dave Olsen, http://dmolsen.com
6+ *
7+ * Released under the MIT license
8+ */
9+ namespace UAParser \Tests \Result ;
10+
11+ use PHPUnit_Framework_TestCase as AbstractTestCase ;
12+ use UAParser \Result \UserAgent ;
13+
14+ class UserAgentTest extends AbstractTestCase
15+ {
16+ /** @var UserAgent */
17+ private $ userAgent ;
18+
19+ public function setUp ()
20+ {
21+ $ this ->userAgent = new UserAgent ();
22+ }
23+
24+ public function testBugWith0InVersion ()
25+ {
26+ $ this ->userAgent ->major = 0 ;
27+ $ this ->userAgent ->minor = 0 ;
28+ $ this ->userAgent ->patch = 0 ;
29+
30+ $ this ->assertSame ('0.0.0 ' , $ this ->userAgent ->toVersion ());
31+ $ this ->assertSame ('Other 0.0.0 ' , $ this ->userAgent ->toString ());
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * ua-parser
4+ *
5+ * Copyright (c) 2011-2012 Dave Olsen, http://dmolsen.com
6+ *
7+ * Released under the MIT license
8+ */
9+ namespace UAParser \Tests \Result ;
10+
11+ use PHPUnit_Framework_TestCase as AbstractTestCase ;
12+ use UAParser \Result \OperatingSystem ;
13+
14+ class OperatingSystemTest extends AbstractTestCase
15+ {
16+ /** @var OperatingSystem */
17+ private $ operatingSystem ;
18+
19+ public function setUp ()
20+ {
21+ $ this ->operatingSystem = new OperatingSystem ();
22+ }
23+
24+ public function testBugWith0InVersion ()
25+ {
26+ $ this ->operatingSystem ->major = 0 ;
27+ $ this ->operatingSystem ->minor = 0 ;
28+ $ this ->operatingSystem ->patch = 0 ;
29+ $ this ->operatingSystem ->patchMinor = 0 ;
30+
31+ $ this ->assertSame ('0.0.0.0 ' , $ this ->operatingSystem ->toVersion ());
32+ $ this ->assertSame ('Other 0.0.0.0 ' , $ this ->operatingSystem ->toString ());
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments