Skip to content

Commit c34adb3

Browse files
committed
chore: add some tests for std/collection
1 parent 2d5b59d commit c34adb3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/Std/CollectionTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Toolkit\StdlibTest\Std;
4+
5+
use Toolkit\Stdlib\Std\Collection;
6+
use Toolkit\StdlibTest\BaseLibTestCase;
7+
8+
/**
9+
* class CollectionTest
10+
*
11+
* @author inhere
12+
*/
13+
class CollectionTest extends BaseLibTestCase
14+
{
15+
public function testCollection_basic(): void
16+
{
17+
$c = Collection::new(['age' => 23, 'name' => 'inhere']);
18+
19+
$this->assertTrue($c->has('age'));
20+
$this->assertEquals(23, $c->get('age'));
21+
$this->assertEquals(23, $c->getInt('age'));
22+
$this->assertEquals('23', $c->getString('age'));
23+
}
24+
}

0 commit comments

Comments
 (0)