Skip to content

Commit c374bb1

Browse files
committed
Add tests for #28. Changelog.
1 parent b954f98 commit c374bb1

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
## Unreleased
33

4+
## 0.3.1 - 2021-07-31
5+
6+
### Fixed
7+
8+
- Cast Memory and Timeout to integers. Fixes [#28](https://github.com/hammerstonedev/sidecar/issues/28)
9+
410
## 0.3.0 - 2021-07-20
511

612
### Added

tests/Unit/FunctionTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,19 @@ public function app_name_with_a_space_gets_dashed()
2121
(new EmptyTestFunction)->nameWithPrefix()
2222
);
2323
}
24+
25+
/** @test */
26+
public function memory_and_timeout_get_cast_to_ints()
27+
{
28+
config([
29+
'sidecar.timeout' => '5',
30+
'sidecar.memory' => '500'
31+
]);
32+
33+
$array = (new EmptyTestFunction)->toDeploymentArray();
34+
35+
$this->assertSame(5, $array['Timeout']);
36+
$this->assertSame(500, $array['MemorySize']);
37+
}
38+
2439
}

tests/Unit/Support/EmptyTestFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public function handler()
1616

1717
public function package()
1818
{
19-
//
19+
return optional();
2020
}
2121
}

0 commit comments

Comments
 (0)