From a699d9064e1d3baaa70fa148745b51be601c4f9c Mon Sep 17 00:00:00 2001 From: Mark Horninger Date: Thu, 14 Feb 2019 13:57:57 -0500 Subject: [PATCH 1/2] #30 Updated String Method Test to try to recreate the issue from the initial bug, added composer.json suggestions --- composer.json | 4 ++++ test/Mhorninger/MySQLite/StringMethodTest.php | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 517a23c..cd3a244 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,10 @@ "phpunit/php-code-coverage": "^6.1@dev", "php-coveralls/php-coveralls": "2.1.x-dev" }, + "suggest": { + "symfony/intl": "If you just need the en locale", + "ext-intl": "For locales other than en" + }, "license": "MIT", "authors": [ { diff --git a/test/Mhorninger/MySQLite/StringMethodTest.php b/test/Mhorninger/MySQLite/StringMethodTest.php index 45232bb..72a68ae 100644 --- a/test/Mhorninger/MySQLite/StringMethodTest.php +++ b/test/Mhorninger/MySQLite/StringMethodTest.php @@ -49,6 +49,14 @@ public function testFormatNull() $this->assertNull($result->value); } + public function testFormatWithMathProblem() + { + $query = "SELECT FORMAT((3600 * 1.7 / 281), 1) as value"; + $result = $this->conn->selectOne($query); + $expected = '21.8'; + $this->assertEquals($expected, $result->value); + } + //endregion //region LPAD tests @@ -74,6 +82,5 @@ public function testLpadNull() $result = $this->conn->selectOne($query); $this->assertNull($result->value); } - //endregion } From 5ae1d52ab6c8023f125cff64160395c38f3b944f Mon Sep 17 00:00:00 2001 From: Mark Horninger Date: Thu, 14 Feb 2019 14:18:25 -0500 Subject: [PATCH 2/2] #30 Fixed issue from StyleCI --- test/Mhorninger/MySQLite/StringMethodTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Mhorninger/MySQLite/StringMethodTest.php b/test/Mhorninger/MySQLite/StringMethodTest.php index 72a68ae..588db19 100644 --- a/test/Mhorninger/MySQLite/StringMethodTest.php +++ b/test/Mhorninger/MySQLite/StringMethodTest.php @@ -51,7 +51,7 @@ public function testFormatNull() public function testFormatWithMathProblem() { - $query = "SELECT FORMAT((3600 * 1.7 / 281), 1) as value"; + $query = 'SELECT FORMAT((3600 * 1.7 / 281), 1) as value'; $result = $this->conn->selectOne($query); $expected = '21.8'; $this->assertEquals($expected, $result->value);