ObjectBoxTest.php 638 B

123456789101112131415161718192021222324252627282930
  1. <?php declare(strict_types=1);
  2. /**
  3. * This file is part of toolkit/stdlib.
  4. *
  5. * @author https://github.com/inhere
  6. * @link https://github.com/php-toolkit/stdlib
  7. * @license MIT
  8. */
  9. namespace Toolkit\StdlibTest\Obj;
  10. use Toolkit\Stdlib\Obj\ObjectBox;
  11. use Toolkit\StdlibTest\BaseLibTestCase;
  12. /**
  13. * class ObjectBoxTest
  14. *
  15. * @author inhere
  16. */
  17. class ObjectBoxTest extends BaseLibTestCase
  18. {
  19. public function testObjectBox_basic(): void
  20. {
  21. $box = ObjectBox::new();
  22. $box->set('name1', 'inhere');
  23. $this->assertTrue($box->has('name1'));
  24. $this->assertEquals('inhere', $box->get('name1'));
  25. }
  26. }