Skip to content

Commit

Permalink
fix(strings): fix tests and methods toNull and isNull
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed May 8, 2022
1 parent 7299b51 commit 2e2f46d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a name="4.3.1"></a>
# [4.3.1](https://github.com/glowyphp/strings) (2022-05-08)
* Fix toNull() method.

<a name="4.3.0"></a>
# [4.3.0](https://github.com/glowyphp/strings) (2022-05-08)
* Added isNull() method.
Expand Down
4 changes: 2 additions & 2 deletions src/Strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2138,9 +2138,9 @@ public function toFloat(): float
/**
* Return Strings object as null.
*
* @return float Return Strings object as null.
* @return null Return Strings object as null.
*/
public function toNull(): float
public function toNull()
{
return null;
}
Expand Down
4 changes: 4 additions & 0 deletions tests/StringsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,10 @@
$this->assertTrue(Strings::create('null')->isNull());
});

test('test toNull() method', function (): void {
$this->assertTrue(Strings::create('null')->toNull() === null);
});

test('test isMAC() method', function (): void {
$this->assertTrue(Strings::create('00:11:22:33:44:55')->isMAC());
$this->assertFalse(Strings::create('127.0.0.1')->isMAC());
Expand Down

0 comments on commit 2e2f46d

Please sign in to comment.