Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/Support/SupportHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use ArrayAccess;
use ArrayIterator;
use Countable;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Env;
use Illuminate\Support\Optional;
Expand Down Expand Up @@ -39,6 +40,21 @@ public function testClassBasename()
$this->assertSame('Baz', class_basename('Baz'));
}

public function testFilled()
{
$this->assertFalse(filled(null));
$this->assertFalse(filled(''));
$this->assertFalse(filled(' '));
$this->assertTrue(filled(10));
$this->assertTrue(filled(true));
$this->assertTrue(filled(false));
$this->assertTrue(filled(0));
$this->assertTrue(filled(0.0));

$object = new SupportTestCountable();
$this->assertFalse(filled($object));
}

public function testValue()
{
$this->assertSame('foo', value('foo'));
Expand Down Expand Up @@ -903,3 +919,11 @@ public function getIterator(): Traversable
return new ArrayIterator($this->items);
}
}

class SupportTestCountable implements Countable
{
public function count(): int
{
return 0;
}
}