<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Paul Thébaud</title>
    <description>The latest articles on Forem by Paul Thébaud (@paulthebaud).</description>
    <link>https://forem.com/paulthebaud</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F60346%2Ffc02285a-58f5-4581-8cbb-613980f97014.jpg</url>
      <title>Forem: Paul Thébaud</title>
      <link>https://forem.com/paulthebaud</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/paulthebaud"/>
    <language>en</language>
    <item>
      <title>PhpUnitGen, testing, the new way!</title>
      <dc:creator>Paul Thébaud</dc:creator>
      <pubDate>Wed, 03 Jun 2020 07:12:21 +0000</pubDate>
      <link>https://forem.com/paulthebaud/phpunitgen-testing-the-new-way-3jf</link>
      <guid>https://forem.com/paulthebaud/phpunitgen-testing-the-new-way-3jf</guid>
      <description>&lt;p&gt;You are part of the very exclusive club of PHP developers and you inflict yourself swirls of copy/paste to satisfy PHPUnit?&lt;br&gt;
Unit tests haunt you even in your nightmares?&lt;/p&gt;

&lt;p&gt;PhpUnitGen has been designed to make your nights sweater and your apps better tested!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is PhpUnitGen?
&lt;/h2&gt;

&lt;p&gt;PhpUnitGen is a development tool for PHP 7.1 and up, which allows you to generate PHPUnit tests skeletons.&lt;/p&gt;

&lt;p&gt;The project started in 2017. The first version, named &lt;code&gt;phpunit-generator&lt;/code&gt; was released in 2018.&lt;/p&gt;

&lt;p&gt;Here are some of the main features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detects classes and traits, and instantiates them appropriately.&lt;/li&gt;
&lt;li&gt;Instantiate/mock the classes/traits object/scalar dependencies.&lt;/li&gt;
&lt;li&gt;Automatically generates tests for getter/setter methods.&lt;/li&gt;
&lt;li&gt;Binds with Laravel 5.8+ and the &lt;code&gt;php artisan make&lt;/code&gt; command.&lt;/li&gt;
&lt;li&gt;Free web application and Restful API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I started working on a brand new version in 2019, and it is now time to release it!&lt;/p&gt;

&lt;p&gt;It is more modular, better coded and has new features.&lt;br&gt;
The web application has been totally revised too, and is now working with Laravel Lumen and VueJS/Typescript.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it?
&lt;/h2&gt;

&lt;p&gt;There are many ways of using PhpUnitGen: web application, command line, PHP code and even the Restful API.&lt;/p&gt;

&lt;p&gt;All those possibilities are described in the web application, &lt;a href="https://phpunitgen.io"&gt;phpunitgen.io&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;PhpUnitGen is a tool to generate your PHP unit tests skeletons.&lt;/p&gt;

&lt;p&gt;Just checkout the &lt;a href="https://phpunitgen.io"&gt;phpunitgen.io&lt;/a&gt; website to quickly try the tool.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>php</category>
      <category>testing</category>
      <category>opensource</category>
    </item>
    <item>
      <title>PhpUnitGen, simplify the writing of your unit tests !</title>
      <dc:creator>Paul Thébaud</dc:creator>
      <pubDate>Mon, 26 Mar 2018 17:37:36 +0000</pubDate>
      <link>https://forem.com/paulthebaud/phpunitgen-simplify-the-writing-of-your-unit-tests--4nec</link>
      <guid>https://forem.com/paulthebaud/phpunitgen-simplify-the-writing-of-your-unit-tests--4nec</guid>
      <description>&lt;h2&gt;
  
  
  This article is outdated. Check out the new one:
&lt;/h2&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/paulthebaud" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F60346%2Ffc02285a-58f5-4581-8cbb-613980f97014.jpg" alt="paulthebaud"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/paulthebaud/phpunitgen-testing-the-new-way-3jf" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;PhpUnitGen, testing, the new way!&lt;/h2&gt;
      &lt;h3&gt;Paul Thébaud ・ Jun 3 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#showdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#php&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#testing&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#opensource&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;





&lt;p&gt;You are part of the very exclusive club of &lt;em&gt;PHP&lt;/em&gt; developers and you inflict yourself swirls of copy/paste to satisfy &lt;em&gt;PHPUnit&lt;/em&gt;?&lt;br&gt;
Unit tests haunt you even in your nightmares?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PhpUnitGen&lt;/strong&gt; has been designed to make your nights sweater and your apps better tested!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.github.com%2Fpaul-thebaud%2Fphpunit-generator-assets%2Fmaster%2Flogos%2Flogo.svg%3Fsanitize%3Dtrue" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.github.com%2Fpaul-thebaud%2Fphpunit-generator-assets%2Fmaster%2Flogos%2Flogo.svg%3Fsanitize%3Dtrue" width="1200" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PhpUnitGen&lt;/strong&gt; is an &lt;strong&gt;online&lt;/strong&gt; or &lt;strong&gt;terminal&lt;/strong&gt; development tool for generating your unit test skeletons for &lt;em&gt;PHP&lt;/em&gt; code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why PhpUnitGen?
&lt;/h2&gt;

&lt;p&gt;Like everyone else, I have to work to eat, and eat to work (even if development is a passion, huh).&lt;br&gt;
I already had a taste of loop in the mouth, and my job was to test a PHP application.&lt;br&gt;
What is more boring and uninteresting than recreating another skeleton of tests for an umpteenth PHP file ? A Formula 1 race maybe...&lt;/p&gt;

&lt;p&gt;Starting from this postulate, I found myself wanting to "congratulate" the genius that would automatically generate all my skeletons of unit tests and thus save me a lot of time.&lt;/p&gt;

&lt;p&gt;I modestly created this tool.&lt;br&gt;
&lt;strong&gt;PhpUnitGen&lt;/strong&gt; was born.&lt;/p&gt;

&lt;p&gt;I then told myself that it might be better to take advantage of the time gained, rather than spend it in front of Netflix, and I published the tool in &lt;strong&gt;open source&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is PhpUnitGen?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;PhpUnitGen&lt;/strong&gt; is a development tool, programmed in &lt;em&gt;PHP7.1&lt;/em&gt;, which allows generating unit tests skeletons from a &lt;em&gt;PHP&lt;/em&gt; source code.&lt;/p&gt;

&lt;p&gt;The generated tests are written in &lt;em&gt;PHP7.1&lt;/em&gt; and to work with &lt;em&gt;PHPUnit 6/7&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Here are some of &lt;strong&gt;PhpUnitGen features&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It automatically detects &lt;em&gt;classes&lt;/em&gt;, &lt;em&gt;traits&lt;/em&gt; or other formats and instantiates them appropriately.&lt;/li&gt;
&lt;li&gt;It allows to &lt;strong&gt;generat tests automatically&lt;/strong&gt; for &lt;em&gt;getter&lt;/em&gt;/&lt;em&gt;setter&lt;/em&gt; methods.&lt;/li&gt;
&lt;li&gt;It proposes many &lt;em&gt;PHP&lt;/em&gt; annotations allowing to create simple tests, &lt;em&gt;mocks&lt;/em&gt; or instantiations of &lt;em&gt;classes&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to use it?
&lt;/h2&gt;

&lt;p&gt;There are two ways to use &lt;strong&gt;PhpUnitGen&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Via the web application (&lt;strong&gt;open source&lt;/strong&gt;): &lt;a href="https://phpunitgen.io" rel="noopener noreferrer"&gt;phpunitgen.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Via the &lt;em&gt;Composer&lt;/em&gt; package that is used with a &lt;strong&gt;terminal&lt;/strong&gt; (also open source): &lt;a href="https://github.com/paul-thebaud/phpunit-generator" rel="noopener noreferrer"&gt;paulthebaud/phpunit-generator&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to help improve PhpUnitGen ?
&lt;/h2&gt;

&lt;p&gt;You can help improve PhpUnitGen by sending all your comments / bugs via &lt;a href="https://github.com/paul-thebaud/phpunit-generator/issues" rel="noopener noreferrer"&gt;Github issues&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also share the link of this article, the package or the web application!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank you for reading, and see you soon!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>php</category>
      <category>testing</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
