PhpStorm Live Template & Postfix Snippets

All "Data generation" Snippets

$date$

Get the current date.

$date$
<template name="$date$" value="'$date$'$END$" description="Generate the current date" toReformat="false" toShortenFQNames="true">
<variable name="date" expression="date(&quot;yyyy-MM-dd'T'HH:mm:ss.SSSz&quot;)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP Expression" value="true" />
</context>
</template>

Live template

Do you speak French and want to stop hating your tests ?

A cover picture saying "Améliorez vos tests automatisés" with a burrito.

I've created a course to help developers to improve their automated tests.

I share ideas and technics to improve slow, flaky, failing for unexpected reason and hard to understand tests until they become tests we take joy to work with !

But you'll need to understand French...

$uuid$

Generate an UUID.

$uuid$
<template name="$uuid$" value="'$uuid$'$END$" description="Generate an UUID" toReformat="false" toShortenFQNames="true">
<variable name="uuid" expression="groovyScript(&quot;UUID.randomUUID().toString()&quot;) " defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP Expression" value="true" />
</context>
</template>

Live template