Skip to content

Commit 6db3637

Browse files
committed
Allow an empty tariff to be set
1 parent 2c6ba68 commit 6db3637

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
All notable changes to `CMSMS` will be documented in this file
44

5+
## [0.0.5] - 2016-09-29
6+
#### Fixed
7+
- Allow an empty `tariff` to be set.
8+
59
## [0.0.4] - 2016-09-13
610
#### Fixed
7-
- Moved the `tariff` field under the correct XML child
11+
- Moved the `tariff` field under the correct XML child.
812

913
## [0.0.3] - 2016-09-12
1014
#### Added

src/CmsmsMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function reference($reference)
8282
*/
8383
public function tariff($tariff)
8484
{
85-
if (empty($tariff) || ! is_int($tariff)) {
85+
if (! is_int($tariff)) {
8686
throw InvalidMessage::invalidTariff($tariff);
8787
}
8888

tests/CmsmsMessageTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ public function it_can_set_tariff()
106106
}
107107

108108
/** @test */
109-
public function it_cannot_set_an_empty_tariff()
109+
public function it_can_set_an_empty_tariff()
110110
{
111-
$this->setExpectedException(InvalidMessage::class);
111+
$message = (new CmsmsMessage)->tariff(0);
112112

113-
(new CmsmsMessage)->tariff(0);
113+
$this->assertEquals(0, $message->getTariff());
114114
}
115115

116116
/** @test */

0 commit comments

Comments
 (0)