Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit c5491f6

Browse files
committed
Simplified test
1 parent 858cdb3 commit c5491f6

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/Decimal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static function fromString($strValue, $scale = null)
174174
throw new InvalidArgumentTypeException(
175175
array('string'),
176176
is_object($strValue) ? get_class($strValue) : gettype($strValue),
177-
'$strVlue must be of type string'
177+
'$strVlue must be of type string.'
178178
);
179179
}
180180

@@ -212,7 +212,7 @@ public static function fromString($strValue, $scale = null)
212212

213213
} else {
214214
throw new \InvalidArgumentException(
215-
'$strValue must be a string that represents uniquely a float point number'
215+
'$strValue must be a string that represents uniquely a float point number.'
216216
);
217217
}
218218

tests/Decimal/DecimalFromStringTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,18 @@ public function testExponentialNotationString_With_NegativeExponent_And_Negative
6767
);
6868
}
6969

70+
/**
71+
* @expectedException Litipk\Exceptions\InvalidArgumentTypeException
72+
* @expectedExceptionMessage $strVlue must be of type string.
73+
*/
7074
public function testNoString()
7175
{
72-
$catched = false;
73-
74-
try {
75-
$n = Decimal::fromString(5.1);
76-
} catch (Exception $e) {
77-
$catched = true;
78-
}
79-
80-
$this->assertTrue($catched);
76+
Decimal::fromString(5.1);
8177
}
8278

8379
/**
8480
* @expectedException \InvalidArgumentException
85-
* @expectedExceptionMessage $strValue must be a string that represents uniquely a float point number
81+
* @expectedExceptionMessage $strValue must be a string that represents uniquely a float point number.
8682
*/
8783
public function testBadString()
8884
{

0 commit comments

Comments
 (0)