StringsUtilsTest.php 675 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Tests\Service\Utils;
  3. use App\Service\Utils\StringsUtils;
  4. use PHPUnit\Framework\TestCase;
  5. class StringsUtilsTest extends TestCase
  6. {
  7. /**
  8. * @see StringsUtils::unquote()
  9. */
  10. public function testUnquote():void
  11. {
  12. $this->assertEquals("foo", StringsUtils::unquote("'foo"));
  13. }
  14. /**
  15. * @see StringsUtils::camelToSnake()
  16. */
  17. public function testCamelToSnake(): void {
  18. $this->assertEquals("foo_bar", StringsUtils::camelToSnake("FooBar"));
  19. $this->assertEquals("foo-bar", StringsUtils::camelToSnake("FooBar", '-'));
  20. $this->assertEquals("foo_bar", StringsUtils::camelToSnake("fooBar"));
  21. }
  22. }