getFunctions(); $this->assertExtensionExists('uuid', [$extension, 'getUuid'], $functions); $this->assertExtensionExists('uuidBy', [$extension, 'getUuidBy'], $functions); } /** * @covers \Engelsystem\Renderer\Twig\Extensions\Uuid::getUuid */ public function testGetUuid(): void { $extension = new Uuid(); $uuid = $extension->getUuid(); $this->assertTrue(Str::isUuid($uuid)); } /** * @covers \Engelsystem\Renderer\Twig\Extensions\Uuid::getUuidBy */ public function testGetUuidBy(): void { $extension = new Uuid(); $uuid = $extension->getUuidBy('test'); $this->assertTrue(Str::isUuid($uuid)); $this->assertEquals('098f6bcd-4621-4373-8ade-4e832627b4f6', $uuid); $uuid = $extension->getUuidBy('test', '1337'); $this->assertTrue(Str::isUuid($uuid)); $this->assertStringStartsWith('1337', $uuid); } }