diff --git a/tests/Support/SupportStringableTest.php b/tests/Support/SupportStringableTest.php index e40003f04a5f..9f8dbaf64944 100644 --- a/tests/Support/SupportStringableTest.php +++ b/tests/Support/SupportStringableTest.php @@ -109,6 +109,23 @@ public function testWhenEmpty() })); } + public function testWhenNotEmpty() + { + tap($this->stringable(), function ($stringable) { + $this->assertSame($stringable, $stringable->whenNotEmpty(function ($stringable) { + return $stringable.'.'; + })); + }); + + $this->assertSame('', (string) $this->stringable()->whenNotEmpty(function ($stringable) { + return $stringable.'.'; + })); + + $this->assertSame('Not empty.', (string) $this->stringable('Not empty')->whenNotEmpty(function ($stringable) { + return $stringable.'.'; + })); + } + public function testWhenFalse() { $this->assertSame('when', (string) $this->stringable('when')->when(false, function ($stringable, $value) {