<?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>DEV Community: Joshua Johnson</title>
    <description>The latest articles on DEV Community by Joshua Johnson (@joshualjohnson).</description>
    <link>https://dev.to/joshualjohnson</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%2F50222%2F8319c8ba-aeda-4571-8f15-fd71e75ef328.png</url>
      <title>DEV Community: Joshua Johnson</title>
      <link>https://dev.to/joshualjohnson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joshualjohnson"/>
    <language>en</language>
    <item>
      <title>FireStudio Video Tutorial - Debug Panels</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Sat, 23 Nov 2019 03:15:51 +0000</pubDate>
      <link>https://dev.to/ua1labs/firestudio-video-tutorial-debug-panels-5el</link>
      <guid>https://dev.to/ua1labs/firestudio-video-tutorial-debug-panels-5el</guid>
      <description>&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=yZmFjVfCZ4U"&gt;https://www.youtube.com/watch?v=yZmFjVfCZ4U&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sharing a video I just uploaded as a tutorial and introduction video to FireStudio, a Wordpress plugin packed with tools for developers.&lt;/p&gt;

</description>
      <category>php</category>
      <category>showdev</category>
      <category>wordpress</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Wordpress Action Hooks Order of Execution</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Tue, 19 Nov 2019 14:55:24 +0000</pubDate>
      <link>https://dev.to/ua1labs/wordpress-action-hooks-order-of-execution-4139</link>
      <guid>https://dev.to/ua1labs/wordpress-action-hooks-order-of-execution-4139</guid>
      <description>&lt;p&gt;&lt;a href="https://ua1.us/updates/wordpress/wordpress-hook-order-of-execution/"&gt;https://ua1.us/updates/wordpress/wordpress-hook-order-of-execution/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>The Vision for FireStudio and Our Other UA1 Labs’ PHP “Fire” Libraries</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Fri, 08 Nov 2019 20:00:51 +0000</pubDate>
      <link>https://dev.to/ua1labs/the-vision-for-firestudio-and-our-other-ua1-labs-php-fire-libraries-3ofk</link>
      <guid>https://dev.to/ua1labs/the-vision-for-firestudio-and-our-other-ua1-labs-php-fire-libraries-3ofk</guid>
      <description>&lt;p&gt;At UA1 Labs, over the past 2-3 years we have been busy building out a software suite we call FireStudio. FireStudio, and its accompanying libraries (FireTest, FireBug, FireDi, FireSQL), have all been actively developed for one reason. To enable web users to secure their privacy on the web and services on the web. With the focus of technology on cloud, big data, and machine learning, we have a growing concern of what that means for the average user of the web and their privacy.&lt;/p&gt;

&lt;p&gt;To achieve data privacy we want to make it simple enough for each person to own their data and be able to distribute it via their personal API.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Early on in my career, I recognized an issue with the web. Using any web services would force me to give up my privacy. Everything I do on the web is being tracked, analyzed, and used to target a reaction from me. Most of the time, I’m being targeting to make a purchase, and sometimes I’m targeted to react with an action. Major tech companies have gotten so good at targeting reactions and behaviors, they can even predict, within a certain accuracy, what your reaction will be based on the collection of data they have about you and other people. I don’t want to live in that world.&lt;/p&gt;

&lt;h2&gt;
  
  
  History of FireStudio
&lt;/h2&gt;

&lt;p&gt;Ever since I’ve learned to code, I’ve had a continuation of a dream to build out a system that would allow users of the web to control how their data is used. There has been many variations and implementations of this idea over the past 15 years I’ve been developing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Zoose
&lt;/h3&gt;

&lt;p&gt;For me, it all started with Zoose. My very first attempt at building out a PHP application. It was a CMS that used the concept of editable content to allow users to edit titles/images/content directly within the webpage they were viewing. At the time, it felt like working in word. The framework itself featured a flat file database as I wasn’t sure what MySQL was or how to use it. So I built my own. &lt;a href="http://buildzoose.com"&gt;http://buildzoose.com&lt;/a&gt; was created with a forum and I attempted to open source it. The framework ended up being used in several client’s production servers and did well for a bit. One client still uses it today to run their listing website.&lt;/p&gt;

&lt;h3&gt;
  
  
  Z20 (or Zoose 2.0)
&lt;/h3&gt;

&lt;p&gt;After learning about some design patterns and becoming more mature with my coding practices, I realized how hard Zoose was to maintain. So I decided to start rebuilding Zoose on another code base. This time I would centralize my approach around Dependency Injection. Z20 was a short lived iteration. As a framework built around DI isn’t really a framework at all. Z20 would eventually become Ulfberht, which would then turn into FireDi. I built many different projects with this framework including a Twitter bot that would allow users to tweet pixel information at it that would place that pixel on a canvas in an experiment we called “Social Art” (&lt;a href="https://twitter.com/tweetcreate"&gt;https://twitter.com/tweetcreate&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;This framework became more about making money and less about driving innovation around the cause of data privacy on the web. For me, everything I’ve built, the end goal was to build tools that would allow for a decentralized web that would still allow people to share info, photos, likes, etc. After realizing that things weren’t going in the direction I wanted them to, I decided to pivot yet again and refocus my efforts towards pure data privacy.&lt;/p&gt;

&lt;h3&gt;
  
  
  FireStudio
&lt;/h3&gt;

&lt;p&gt;The idea for FireStudio was born. I decided I would take everything I’ve learned and focus all of my energy on solving the problem I had set out to solve 10 years earlier. I mapped out everything I would need to solve this problem and would just start building. I needed debug tools, testing automation tools, a way to connect to a database, security tools. Everything I would need I listed.&lt;/p&gt;

&lt;h3&gt;
  
  
  FireDB
&lt;/h3&gt;

&lt;p&gt;One of the first things I set my effort on was to build a database that would allow users to secure data. I wanted a NoSQL database that would allow users to store any type of data that they wanted to. But I didn’t want users to have to deal with, “well how do I setup a MongoDB instance to connect to my application?” Sure there is cloud solutions for stuff like this, but that stuff is hard. Especially for the average web user.&lt;/p&gt;

&lt;p&gt;This would become a 4 month journey to build my own flat file database system that users could just download and use. Now archived &lt;a href="https://github.com/joshualjohnson/firedb"&gt;https://github.com/joshualjohnson/firedb&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  FireSQL
&lt;/h3&gt;

&lt;p&gt;Along the way of building out FireDB, I found that the database itself wasn’t very performant after you got to more than 2 million records within a collection. All of the features I wanted were there, but I wanted the database itself to be more performant than it was. So, I took all that I had learned in FireDB and applied it to FireSQL. A solution that would take a SQL database and make it into a NoSQL database. I settled on this as a solution because most LAMP services provide MySQL out of the box.&lt;/p&gt;

&lt;h3&gt;
  
  
  FireBug
&lt;/h3&gt;

&lt;p&gt;FireBug came along because I needed to debug FireSQL/FireDB as I was building it. I wanted the more efficient way to debug and I needed more than just var_dump. I wanted to know how long queries were taking, performance of code, etc. So I created FireBug as a way to have a debug panel that could have all of the things I needed.&lt;/p&gt;

&lt;p&gt;By the way, FireBug’s name was a total accident and was never meant to step on the heals of FireBug the Firefox extension. More about that here &lt;a href="https://dev.to/joshualjohnson/why-did-the-firebug-php-debug-panel-project-copy-it-s-name-from-the-dev-tools-built-for-firefox-3jfj-temp-slug-4462350"&gt;https://ua1.us/updates/firebug/why-did-the-firebug-php-debug-panel-project-copy-its-name-from-the-dev-tools-built-for-firefox/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  FireTest
&lt;/h3&gt;

&lt;p&gt;FireTest came along because when I was building out FireSQL/FireDB, I needed a way to test multiple scenarios as I was developing. The scope grew too big for me to manually test all of its functionality every time I went to add new functionality. So I build out a test automation tool that allowed me to verify everything was still working as expected.&lt;/p&gt;

&lt;h3&gt;
  
  
  FireDi
&lt;/h3&gt;

&lt;p&gt;As mentioned before, this originally came from Z20.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finally FireStudio
&lt;/h3&gt;

&lt;p&gt;It took me a little under 2 years to write all of the code I would need to create all of the components of FireStudio. But yet I still have no app for a user to run that will allow them to share their data on the web without sacrificing privacy! I envision FireStudio to be an application that runs on a server. Which will allow a user to host their own data via a restful API. One that they own and control who can access it. I would like to see apps created that could be used to access individual user api’s. Rather than having to host a user’s data, I would like to see these apps simply consume their data.&lt;/p&gt;

&lt;p&gt;I started to build out a stand alone application, but recently decided to ship this as a WordPress plugin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Put FireStudio In WordPress Plugin?
&lt;/h2&gt;

&lt;p&gt;For me, the answer is simple. The vision for WordPress and the vision for FireStudio are pretty much inline. WordPress wants to make it possible for the world to share information. FireStudio wants to make it possible to share data.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://ua1.us/updates/news/the-vision-for-firestudio-and-our-other-ua1-labs-php-fire-libraries/"&gt;The Vision for FireStudio and Our Other UA1 Labs’ PHP “Fire” Libraries&lt;/a&gt; appeared first on &lt;a href="https://ua1.us"&gt;UA1 Labs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>wordpress</category>
      <category>showdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>FireBug – Adding Your Own Debug Panels</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Fri, 08 Nov 2019 04:17:21 +0000</pubDate>
      <link>https://dev.to/ua1labs/firebug-adding-your-own-debug-panels-1on3</link>
      <guid>https://dev.to/ua1labs/firebug-adding-your-own-debug-panels-1on3</guid>
      <description>&lt;p&gt;In this tutorial, we will cover how to add your own debug panels to FireBug. This feature of FireBug is what really make it a useful tool for what you are developing! Since I recently integrated FireBug into a WordPress Plugin, we will be using this use case for our tutorial today. One goal we had when doing this integration was to add a custom debug panel that would give us all of the SQL Queries that WordPress makes when loading a page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4mAkjC0Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ua1.us/wp-content/uploads/2019/11/firebug-wp-queries.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4mAkjC0Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ua1.us/wp-content/uploads/2019/11/firebug-wp-queries.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Start Creating Your Custom Panel
&lt;/h2&gt;

&lt;p&gt;For this tutorial, we are going to assume you’ve successfully integrated FireBug into your project. To recap the simplest integration looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
$fireBug = \UA1Labs\Fire\Bug::get();
$fireBug-&amp;gt;enable();
echo $fireBug-&amp;gt;render();
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;A custom FireBug debug panel consists of two parts. The class that represents the content of the panel. And the template that is bound to the class to render the results you are looking for. So let’s start by building out your class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
namespace UA1Labs\Fire\Studio\Feature\Debug\Panel;
use \UA1Labs\Fire\Bug\Panel;
class WpSqlQueries extends Panel
{
    const ID = 'wpsqlqueries';
    const NAME = 'Wordpress SQL {{count}}';

    public function __construct()
    {
        parent::__construct(self::ID, self::NAME,__DIR__. '/../templates/panels/sql-queries.phtml');
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Above you will find an example of the basic boilerplate code to start building out the data for your panel. Of course, there are so many ways to create the class. This is the way we do it at UA1 Labs. Other implementations are acceptable as well.&lt;/p&gt;

&lt;p&gt;Notice, we have included a template file within our parent constructor. So let’s go ahead and get the boilerplate code prepared for that part of the custom panel we are creating.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
// nothing to display yet ;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now that you have the basic boiler plate, we can go ahead and start adding the code that will display our queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Custom Code For Displaying WP Queries
&lt;/h2&gt;

&lt;p&gt;Before we get started adding our custom code, let’s first talk about how WordPress gives us the information about the queries it runs to load a page. WordPress has a configuration, that when turned on, will store the settings in its global $wpdb object. So for us to even get these queries, we can simply add define(‘SAVEQUERIES’, true); within our code.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://ua1.us/updates/firebug/firebug-adding-your-own-debug-panels/"&gt;FireBug – Adding Your Own Debug Panels&lt;/a&gt; appeared first on &lt;a href="https://ua1.us"&gt;UA1 Labs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>debug</category>
      <category>showdev</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>FireTest – Example Unit Testing Individual Classes Without A Framework</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Mon, 28 Oct 2019 21:27:32 +0000</pubDate>
      <link>https://dev.to/ua1labs/firetest-example-unit-testing-individual-classes-without-a-framework-74p</link>
      <guid>https://dev.to/ua1labs/firetest-example-unit-testing-individual-classes-without-a-framework-74p</guid>
      <description>&lt;p&gt;I recently got a request on how you might Unit Test an individual class that doesn’t belong to a framework. So, here’s an example class we will be unit testing using FireTest.&lt;/p&gt;

&lt;p&gt;Let’s start out by creating a new project from scratch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir fire-test-example
cd fire-test-example
composer init
...
composer require ua1-labs/firetest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now, update &lt;code&gt;composer.json&lt;/code&gt; to include the test runner file script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    "test": "php vendor/ua1-labs/firetest/scripts/runner.php --dir=/. --ext=.TestCase.php"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now let’s create our example class at &lt;code&gt;src/FormPost.php&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use \Exception;

class FormPost
{
    public $writeToDb;

    public function __construct()
    {
        $this-&amp;gt;writeToDb = false;
    }

    public function handleFormPost()
    {
        $firstName = isset($_POST['firstName']) ? $_POST['firstName'] : '';
        $lastName = isset($_POST['lastName']) ? $_POST['lastName'] : '';
        if ($this-&amp;gt;validateFormData($firstName, $lastName)) {
            $this-&amp;gt;writeToDatabase($firstName, $lastName);
        } else {
            throw new Exception('Please fill in all form data.');
        }
    }

    private function validateFormData($firstName, $lastName)
    {
        // code to verify form data
        if (!$firstName || !$lastName) {
            return false;
        }

        return true;
    }

    private function writeToDatabase()
    {
        // code to write to database
        $this-&amp;gt;writeToDb = true;
    }

}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now add it to Composer’s Autoload schema by adding the following lines to the &lt;code&gt;composer.json&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"autoload": {
    "files": ["src/FormPost.php"]
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now, let’s create our &lt;code&gt;src/FormPost.TestCase.php&lt;/code&gt; file. I’ve already created the unit test scenarios we are going to test for.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use \UA1Labs\Fire\Test\TestCase;

class FormPostTestCase extends TestCase
{

    private $formPost;

    public function beforeEach()
    {
        $_POST = [];
        $this-&amp;gt;formPost = new FormPost();
    }

    public function testHandleFormPost()
    {
        $this-&amp;gt;should('Validate a form and write the values to a database.');
        $_POST['firstName'] = 'UA1';
        $_POST['lastName'] = 'LABS';
        $this-&amp;gt;formPost-&amp;gt;handleFormPost();
        $this-&amp;gt;assert($this-&amp;gt;formPost-&amp;gt;writeToDb === true);
    }

    public function testHandleFormPostBadRequest()
    {
        $this-&amp;gt;should('Throw an Exception because form data is missing.');
        try{
            $this-&amp;gt;formPost-&amp;gt;handleFormPost();
            $this-&amp;gt;assert(false);
        } catch (Exception $e) {
            $this-&amp;gt;assert(true);
        }
    }

}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now that you have your Class and your TestCase file, you are ready to run the unit tests. Remember before we added a run script to the &lt;code&gt;composer.json&lt;/code&gt; file? We are now going to run that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer run test
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Or just run the runner script using the PHP command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php vendor/ua1-labs/firetest/scripts/runner.php --dir=/. --ext=.TestCase.php
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You will get the following results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FireTest: *************************************************************
FireTest: ███████╗██╗██████╗ ███████╗████████╗███████╗███████╗████████╗
FireTest: ██╔════╝██║██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
FireTest: █████╗ ██║██████╔╝█████╗ ██║ █████╗ ███████╗ ██║   
FireTest: ██╔══╝ ██║██╔══██╗██╔══╝ ██║ ██╔══╝ ╚════██║ ██║   
FireTest: ██║ ██║██║ ██║███████╗ ██║ ███████╗███████║ ██║   
FireTest: ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝╚══════╝ ╚═╝   
FireTest: *************************************************************
FireTest: [STARTING] Test suite is located at "/home/tutorials/fire-test-example/src"
FireTest: [STARTING] Finding all files with the extension ".TestCase.php"
FireTest: [LOADING] Test file "/home/tutorials/fire-test-example/src/FormPost.TestCase.php"
FireTest: [LOADING] Test class "FormPostTestCase"
FireTest: [RUNNING] FormPostTestCase::testHandleFormPost()
FireTest: [PASSED] Validate a form and write the values to a database.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] FormPostTestCase::testHandleFormPostBadRequest()
FireTest: [PASSED] Throw an Exception because form data is missing.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: ***********************************************************
FireTest: ███████╗██╗ ██╗ ██████╗ ██████╗███████╗███████╗███████╗
FireTest: ██╔════╝██║ ██║██╔════╝██╔════╝██╔════╝██╔════╝██╔════╝
FireTest: ███████╗██║ ██║██║ ██║ █████╗ ███████╗███████╗
FireTest: ╚════██║██║ ██║██║ ██║ ██╔══╝ ╚════██║╚════██║
FireTest: ███████║╚██████╔╝╚██████╗╚██████╗███████╗███████║███████║
FireTest: ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝╚══════╝╚══════╝╚══════╝
FireTest: ***********************************************************
FireTest: [FINAL] (Passed: 2, Failed: 0)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://ua1.us/updates/firetest/firetest-example-unit-testing-individual-classes-without-a-framework/"&gt;FireTest – Example Unit Testing Individual Classes Without A Framework&lt;/a&gt; appeared first on &lt;a href="https://ua1.us"&gt;UA1 Labs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>test</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How do you solve the data privacy issues of the internet?</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Mon, 28 Oct 2019 16:36:32 +0000</pubDate>
      <link>https://dev.to/ua1labs/how-do-you-solve-the-data-privacy-issues-of-the-internet-17hi</link>
      <guid>https://dev.to/ua1labs/how-do-you-solve-the-data-privacy-issues-of-the-internet-17hi</guid>
      <description>&lt;p&gt;If you could invent a solution that solves the problem of data privacy what does that look like?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>PHP Unit Tests with FireTest and FireDI</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Sat, 26 Oct 2019 16:45:03 +0000</pubDate>
      <link>https://dev.to/ua1labs/php-unit-tests-with-firetest-and-firedi-26km</link>
      <guid>https://dev.to/ua1labs/php-unit-tests-with-firetest-and-firedi-26km</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/updates/firetest/the-history-of-firetest/"&gt;As we talked about before&lt;/a&gt;, at UA1 Labs, we were interested in testing our PHP code, but didn’t want to deal with the overhead and complexity of the current PHP testing frameworks. We thought we could make it simpler. So we created our own PHP test automation framework (&lt;a href="https://dev.to/projects/firetest/"&gt;FireTest&lt;/a&gt;). Along with FireTest, we created a Dependency Injection library (&lt;a href="https://dev.to/projects/firedi/"&gt;FireDI&lt;/a&gt;). When building out FireDI, we decided to add functionality that would allow us to easily mock our dependencies so that that isolating our classes and testing our code would be easy.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A little disclaimer here: As we share our best practices and code examples, we realize that our ideal workflows and best practices might not match with what you feel works best for you. As we have learned, there are multiple ways to code a project. This is what we find works best for us.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing Unit Tests with FireTest and FireDI
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we will cover our best practices for using FireTest along with FireDI to write unit tests for our PHP code. If you don’t already have FireTest setup in your project, you can follow our &lt;a href="https://dev.to/updates/firetest/firetest-getting-started/"&gt;Getting Started Guide&lt;/a&gt; to get it setup.&lt;/p&gt;

&lt;p&gt;Writing tests for &lt;code&gt;MyClass&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use \MyDependency;

class MyClass 
{
    private $myDependency;

    public function __construct(MyDependency $myDependency)
    {
        $this-&amp;gt;myDependency = $myDependency;
    }

    public function myLogicalFunction()
    {
        if ($this-&amp;gt;myDependency-&amp;gt;isLogicalToDoSo()) {
            return true;
        }
        return false;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can see in the &lt;code&gt;MyClass&lt;/code&gt; example above, to test the &lt;code&gt;myLogicalFunction()&lt;/code&gt;, you will need to create test cases for both when &lt;code&gt;$this-&amp;gt;myDependency-&amp;gt;isLogicalToDoSo()&lt;/code&gt; returns &lt;code&gt;true&lt;/code&gt;, and when it returns &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With FireDI, you’ll be able to mock the &lt;code&gt;MyDependency&lt;/code&gt; class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use \UA1Labs\Fire\Test\TestCase;
use \UA1Labs\Fire\Di;
use \MyClass;

class MyClassTestCase extends TestCase
{
    private fireDi;
    private myClass;

    public function setUp()
    {
        $this-&amp;gt;fireDi = new Di();
    }

    public function tearDown()
    {
        unset($this-&amp;gt;fireDi);
    }

    public function testMyLogicalFunction()
    {
        $this-&amp;gt;fireDi-&amp;gt;set('MyDependency', new MyDependencyMock());
        $myDependency = $this-&amp;gt;fireDi-&amp;gt;get('MyDependency');
        $myClass = $this-&amp;gt;fireDi-&amp;gt;get('MyClass');

        $this-&amp;gt;should('Return true when MyDependency::isLogicalToDoSo() returns true');
        $myDependency-&amp;gt;isLogicalToDoSoValue = true;
        $this-&amp;gt;assert($myClass-&amp;gt;myLogicalFunction() === true);

        $this-&amp;gt;should('Return false when MyDependency::isLogicalToDoSo() returns false');
        $myDependency-&amp;gt;isLogicalToDoSoValue = false;
        $this-&amp;gt;assert($myClass-&amp;gt;myLogicalFunction() === false);
    }

}

class MyDependencyMock
{
    public $isLogicalToDoSoValue;

    public function isLogicalToDoSo()
    {
        return $this-&amp;gt;isLogicalToDoSoValue;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the test case above, you will see where &lt;code&gt;MyDependency&lt;/code&gt; was mocked with &lt;code&gt;MyDependencyMock&lt;/code&gt; using &lt;code&gt;$this-&amp;gt;fireDi-&amp;gt;set('MyDependency', new MyDependencyMock());&lt;/code&gt;. We then used FireDI to gain access to the instance of &lt;code&gt;MyDependencyMock&lt;/code&gt; so that we could set the variable &lt;code&gt;isLogicalToDoSoValue&lt;/code&gt;. This is so when MyClass called the &lt;code&gt;isLogicalToDoSo()&lt;/code&gt; method, it would return the desired value of &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;, depending on which test case you were testing for.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://ua1.us/updates/firetest/php-unit-tests-with-firetest-and-firedi/"&gt;PHP Unit Tests with FireTest and FireDI&lt;/a&gt; appeared first on &lt;a href="https://ua1.us"&gt;UA1 Labs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>showdev</category>
    </item>
    <item>
      <title>FireDI Release 2.1.0</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Fri, 18 Oct 2019 10:34:44 +0000</pubDate>
      <link>https://dev.to/ua1labs/firedi-release-2-1-0-49pi</link>
      <guid>https://dev.to/ua1labs/firedi-release-2-1-0-49pi</guid>
      <description>&lt;h2&gt;
  
  
  FireDI 2.1.0 was just released. Here’s what’s new:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Implemented PSR-11 Container Interface. Here’s what that means. FireDI is compliant with an agreed upon standard for how you should implement a container of objects.&lt;/li&gt;
&lt;li&gt;Updated code base to follow PSR-2 Coding Standards. In a previous work situation, we followed Zend 1.* standards for coding. I adopted many of those not working on a modern framework. I had to update the code base to be compliant with PSR-2.&lt;/li&gt;
&lt;li&gt;Implemented Di::has(). As part of the PSR-11 standard, I had to add a method to determine if this particular container “has” an object in it. So what that means under the hood is can this container resolve what you are asking for.&lt;/li&gt;
&lt;li&gt;Updated the Di::set() interface to take in a callable and updated the logic of dependency resolution to invoke the callable as part of resolving the dependency. That means you can set factories to return objects for specific dependencies.&lt;/li&gt;
&lt;li&gt;Included an MIT license! This way you can trust that the code you are using cannot be taken back from you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://ua1.us/updates/firedi/firedi-release-2-1-0/"&gt;FireDI Release 2.1.0&lt;/a&gt; appeared first on &lt;a href="https://ua1.us"&gt;UA1 Labs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>showdev</category>
    </item>
    <item>
      <title>FireDI – Advanced Use Cases</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Thu, 17 Oct 2019 22:25:46 +0000</pubDate>
      <link>https://dev.to/ua1labs/firedi-advanced-use-cases-1n2</link>
      <guid>https://dev.to/ua1labs/firedi-advanced-use-cases-1n2</guid>
      <description>&lt;p&gt;FireDI can do a lot more than just resolve your dependencies for you. This tutorial, we are going to cover other scenarios where FireDI can become helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  For Mocking In Test Cases
&lt;/h2&gt;

&lt;p&gt;When working on testing your code, you will find that from time to time, you will need to mock a dependency for the class you are testing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
class TheClassImTesting {
    public function __construct(MyDependentClass $myDependentClass) {}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now to mock &lt;code&gt;MyDependentClass&lt;/code&gt;!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
$fireDi = new \UA1Labs\Fire\Di();
$myDependentClassMock = Mock::get('MyDependentClass');
$fireDi-&amp;gt;set('MyDependentClass', $myDependentClassMock);

$theClassImTesting = $fireDi-&amp;gt;get('TheClassImTesting');
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  For Injecting New Objects Every Time
&lt;/h2&gt;

&lt;p&gt;By default, FireDI will cache all objects (including object dependencies) within the container object cache. This is so the next time you need the object, it is already ready for you and is just simply returns. From time to time, however, you may need for a specific object to return a new instance every time it is needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
// to prevent an object from caching, you may pass a factory into the Di::set() method.

$fireDi = new \UA1Labs\Fire\Di();
$fireDi-&amp;gt;set('MyNewObjectEveryTime', function() {
    new MyNewObjectEveryTime();
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  For Interface Dependencies
&lt;/h2&gt;

&lt;p&gt;In many cases, you might have a class that has a constructor dependency on an interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
inteface MyInterface {}

class MyClass implements MyInterface {}

class InterfaceDependentClass 
{
    public function __construct(MyInterface $MyInterface) {}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the example above, you will notice that &lt;code&gt;InterfaceDependentClass&lt;/code&gt; depends on an object that implements &lt;code&gt;MyInterface&lt;/code&gt;. If you want to resolve this, you would need to &lt;code&gt;new MyClass()&lt;/code&gt; and pass the resulting instance object into the &lt;code&gt;InterfaceDependentClass&lt;/code&gt; constructor. Or you can simply have FireDI do that for you!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
$fireDi = new \UA1Labs\Fire\Di();
$myClass = $fireDi-&amp;gt;get('MyClass');
$fireDi-&amp;gt;set('MyInterface', $myClass);

$interfaceDependentClass = $fireDi-&amp;gt;get('InterfaceDependentClass');
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The post &lt;a href="https://ua1.us/updates/firedi/firedi-advanced-use-cases/"&gt;FireDI – Advanced Use Cases&lt;/a&gt; appeared first on &lt;a href="https://ua1.us"&gt;UA1 Labs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>discuss</category>
      <category>showdev</category>
    </item>
    <item>
      <title>What's Your Favorite PHP Test Automation Tools?</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Wed, 16 Oct 2019 13:29:53 +0000</pubDate>
      <link>https://dev.to/ua1labs/what-s-your-favorite-php-test-automation-tools-26b5</link>
      <guid>https://dev.to/ua1labs/what-s-your-favorite-php-test-automation-tools-26b5</guid>
      <description>

</description>
      <category>php</category>
      <category>discuss</category>
    </item>
    <item>
      <title>FireTest – Getting Started</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Mon, 14 Oct 2019 21:19:37 +0000</pubDate>
      <link>https://dev.to/ua1labs/firetest-getting-started-2cf4</link>
      <guid>https://dev.to/ua1labs/firetest-getting-started-2cf4</guid>
      <description>&lt;p&gt;Getting started with FireTest is easy. Our goal with FireTest was to make it as simple as possible to integrate it into your project and start writing tests for the code you’ve written.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install FireTest
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require ua1-labs/firetest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Your First Test
&lt;/h2&gt;

&lt;p&gt;Creating test cases in FireTest is as simple as adding a TestCase class and running the FireTest runner.php script. Your first step into creating FireTest Test Cases are to find the class you’d like to test. Create a file in the same directory and call it &lt;code&gt;{classname}.TestCase.php&lt;/code&gt;. Copy and paste the boiler plate code into the newly created Test Case file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use UA1Labs\Fire\Test\TestCase;

class MyTestCase extends TestCase
{
    //my test suite logic
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now you may use event hook methods to bootstrap your tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Event Hook Methods In Test Cases
&lt;/h2&gt;

&lt;p&gt;With every test that you write, you will need to setup the environment to setup your test environment to run your code in. For example, almost for every test you write, you will first need to obtain a new instance of the object you are testing. Event Hook Methods are going to give you the ability to do this.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;setUp()&lt;/code&gt; A method that is invoked when the when the testcase is first intialized.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;beforeEach()&lt;/code&gt; A method that is invoked before each test method is invoked.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;afterEach()&lt;/code&gt; A method that is invoked after each test method is invoked.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tearDown()&lt;/code&gt; A method that is invoked when the test case is finish running all test methods.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Test Methods
&lt;/h2&gt;

&lt;p&gt;Test methods are another kind of event hook. The test method is where you will actually test your code. FireTest will loop through each of these test methods and execute the code. These methods are ran between the &lt;code&gt;beforeEach()&lt;/code&gt; and &lt;code&gt;afterEach()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;Test methods begin with the work “test.” This is how FireTest dictates if it should be running the method during the testing phase of the life cycle. You can name the method whatever you want, however, it will need to begin with the work test (all lowercase).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function testMyCode1()
{
    // my test code here
}

public function testMyCode2()
{
    // my test code here
}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Testing Your Code
&lt;/h2&gt;

&lt;p&gt;Once you have mastered the event hooks and have setup your testing environment, you will then need to be able to tell what test are you running and how you will prove that it was successful. that is where the &lt;code&gt;should()&lt;/code&gt; and &lt;code&gt;assert()&lt;/code&gt; methods come in. To write tests start out by telling what this test is going to prove using a should statement. Think of testing like saying “this test should…” and fill in the blank.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$this-&amp;gt;should('Return a number when I pass in a number.');
$result = my_number_converter(4);
$this-&amp;gt;assert(is_number($result));
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Now Run FireTest Runner.php
&lt;/h2&gt;

&lt;p&gt;FireTest has a built in test runner so that you don’t have to bootstrap your own test suites together. Simply run the following command from the root directory of your project and watch FireTest do its thing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php vendor/ua1-labs/firetest/scripts/runner.php
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Test Results
&lt;/h2&gt;

&lt;p&gt;Test results will then provide you with feedback whether your tests have passed or not.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ua1-labs:firedi josjohns$ php vendor/ua1-labs/firetest/scripts/runner.php
FireTest: *************************************************************
FireTest: ███████╗██╗██████╗ ███████╗████████╗███████╗███████╗████████╗
FireTest: ██╔════╝██║██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
FireTest: █████╗ ██║██████╔╝█████╗ ██║ █████╗ ███████╗ ██║   
FireTest: ██╔══╝ ██║██╔══██╗██╔══╝ ██║ ██╔══╝ ╚════██║ ██║   
FireTest: ██║ ██║██║ ██║███████╗ ██║ ███████╗███████║ ██║   
FireTest: ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝╚══════╝ ╚═╝   
FireTest: *************************************************************
FireTest: [STARTING] Test suite is located at "/home/projects/firedi"
FireTest: [STARTING] Finding all files with the extension ".TestCase.php"
FireTest: [LOADING] Test file "/home/projects/firedi/UA1Labs/Fire/Di/Graph.TestCase.php"
FireTest: [LOADING] Test class "Test\UA1Labs\Fire\Di\GraphTestCase"
FireTest: [LOADING] Test file "/home/projects/firedi/UA1Labs/Fire/Di/ClassDefinition.TestCase.php"
FireTest: [LOADING] Test class "Test\UA1Labs\Fire\Di\ClassDefinitionTestCase"
FireTest: [LOADING] Test file "/home/projects/firedi/UA1Labs/Fire/Di.TestCase.php"
FireTest: [LOADING] Test class "Test\UA1Labs\Fire\DiTestCase"
FireTest: [LOADING] Test file "/home/projects/firedi/vendor/ua1-labs/firetest/UA1Labs/Fire/Test/TestCase.TestCase.php"
FireTest: [LOADING] Test class "Test\UA1Labs\Fire\Test\TestCaseTestCase"
FireTest: [LOADING] Test class "Test\UA1Labs\Fire\Test\TestCaseMock"
FireTest: [LOADING] Test file "/home/projects/firedi/vendor/ua1-labs/firetest/UA1Labs/Fire/Test/Suite.TestCase.php"
FireTest: [LOADING] Test class "Test\UA1Labs\Fire\Test\SuiteTestCase"
FireTest: [RUNNING] Test\UA1Labs\Fire\Di\GraphTestCase::testConstructor()
FireTest: [PASSED] Not throw an exception when the class is constructed
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Di\GraphTestCase::testAddResource()
FireTest: [PASSED] Add a resource to the resource graph.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Di\GraphTestCase::testAddDependencies()
FireTest: [PASSED] Add dependencies to a resource.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Di\GraphTestCase::testAddDependency()
FireTest: [PASSED] Add a dependency to a resource.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Di\GraphTestCase::testRunDependencyCheck()
FireTest: [PASSED] Return an error code of "1" (Resourece Not Found).
FireTest: [PASSED] Contain which resource was missing.
FireTest: [PASSED] Return and error code "2" (Circular Dependnecy).
FireTest: [PASSED] Contain the resource of which caused the circular dependency.
FireTest: [RESULT] (Passed: 4, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Di\GraphTestCase::testGetDependencyResolveOrder()
FireTest: [PASSED] Resolve dependencies in the order they need to be resolved.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Di\GraphTestCase::testResetDependencyCheck()
FireTest: [PASSED] Reset a dependency check.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Di\ClassDefinitionTestCase::testConstructor()
FireTest: [PASSED] Not throw an exception when the class is constructed
FireTest: [PASSED] Have set a serviceId of "Test\UA1Labs\Fire\Di\MyTestClass".
FireTest: [PASSED] Have set a classDef as a ReflectionClass object.
FireTest: [PASSED] Have set a dependency of "Test\UA1Labs\Fire\Di\MyDependentClass"
FireTest: [RESULT] (Passed: 4, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\DiTestCase::testConstructor()
FireTest: [PASSED] The constructor should not throw an execption and be an instance of Di.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\DiTestCase::testPutObject()
FireTest: [PASSED] Put an object in the cache without an exception.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\DiTestCase::testGetObject()
FireTest: [PASSED] Resolve all dependencies for TestClassA and return the TestClassA object.
FireTest: [PASSED] Have placed TestClassA, TestClassB, and TestClassC within the object cache.
FireTest: [PASSED] Resolve all dependencies for TestClassD and return it.
FireTest: [PASSED] Have set ::A as TestClassA on TestClassD object.
FireTest: [PASSED] Have set ::B as TestClassB on TestClassD object.
FireTest: [PASSED] Have set ::C as TestClassC on TestClassB.
FireTest: [PASSED] Throw an exception if a the class you are trying to get does not exists.
FireTest: [PASSED] Throw an exception if a circular dependency is detected.
FireTest: [RESULT] (Passed: 8, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\DiTestCase::testGetWithObject()
FireTest: [PASSED] Return a TestClassB object.
FireTest: [PASSED] Prove that TestClassB has a $C variable that is TestClassC.
FireTest: [PASSED] Prove that the object cache does not contain a TestClassB
FireTest: [PASSED] Throw and exception if a the class you are trying to get does not exists.
FireTest: [RESULT] (Passed: 4, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\DiTestCase::testGetObjectCache()
FireTest: [PASSED] Return an object cache array with a key "TestObject".
FireTest: [PASSED] Return an object cache with the object we put into it.
FireTest: [RESULT] (Passed: 2, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\DiTestCase::testClearObjectCache()
FireTest: [PASSED] Remove all objects from the object cache
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Test\TestCaseTestCase::testConstructor()
FireTest: [PASSED] Return an instance object of the TestCase object without throwing an exception.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: [RUNNING] Test\UA1Labs\Fire\Test\SuiteTestCase::testConstructor()
FireTest: [PASSED] Return an instance object of the Suite object without throwing an exception.
FireTest: [RESULT] (Passed: 1, Failed: 0)
FireTest: ***********************************************************
FireTest: ███████╗██╗ ██╗ ██████╗ ██████╗███████╗███████╗███████╗
FireTest: ██╔════╝██║ ██║██╔════╝██╔════╝██╔════╝██╔════╝██╔════╝
FireTest: ███████╗██║ ██║██║ ██║ █████╗ ███████╗███████╗
FireTest: ╚════██║██║ ██║██║ ██║ ██╔══╝ ╚════██║╚════██║
FireTest: ███████║╚██████╔╝╚██████╗╚██████╗███████╗███████║███████║
FireTest: ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝╚══════╝╚══════╝╚══════╝
FireTest: ***********************************************************
FireTest: [FINAL] (Passed: 33, Failed: 0)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Add The Test Command To Your Composer.json
&lt;/h2&gt;

&lt;p&gt;To make things a lot simpler for you to run all of your test cases, simply add the test runner to the script section of your project’s &lt;code&gt;composer.json&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    "test": "php vendor/ua1-labs/firetest/scripts/runner.php"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The post &lt;a href="https://ua1.us/updates/firetest/firetest-getting-started/"&gt;FireTest – Getting Started&lt;/a&gt; appeared first on &lt;a href="https://ua1.us"&gt;UA1 Labs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>showdev</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>The History of FireTest - A New PHP Test Automation Framework</title>
      <dc:creator>Joshua Johnson</dc:creator>
      <pubDate>Mon, 14 Oct 2019 03:18:44 +0000</pubDate>
      <link>https://dev.to/ua1labs/the-history-of-firetest-a-new-php-test-automation-framework-1cme</link>
      <guid>https://dev.to/ua1labs/the-history-of-firetest-a-new-php-test-automation-framework-1cme</guid>
      <description>&lt;p&gt;UA1 Labs has officially released version 2.0.0 of FireTest. But why are we so focused on building yet another testing framework when there are so many already out there?&lt;/p&gt;

&lt;h2&gt;
  
  
  What Exactly is FireTest?
&lt;/h2&gt;

&lt;p&gt;FireTest is a PHP test automation framework that allows you to automate tests as you write code. It was written in PHP for testing PHP code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Did You Write Your Own Test Automation Framework?
&lt;/h2&gt;

&lt;p&gt;For us the answer was simple, we looked into the many testing frameworks written for PHP and weren’t quite satisfied with what we were seeing. We wanted a light weight and flexible framework that wouldn’t get in the way of our workflow. We wanted to ensure that when we ran our automated tests that the results were valuable to us in catching bugs.&lt;/p&gt;

&lt;p&gt;Most of the frameworks we looked at were so focused on code coverage, unit testing, CAP score. They missed out on the important thing. Does the code I’m writing still do what I want it to? And if we find a bug, how can I write a test so that the same bug doesn’t happen again. All other frameworks we worked with didn’t provide the flexibility we were looking for.&lt;/p&gt;

&lt;p&gt;So we invented FireTest! We admit, it seems primitive in nature compared to the other popular testing frameworks, but we feel like we needed to get back to basics. Stop bloating our testing to reduce the complexity of the code you are writing. Instead we wanted to focus on simplicity and ease of use.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://ua1.us/updates/firetest/the-history-of-firetest/"&gt;The History of FireTest&lt;/a&gt; appeared first on &lt;a href="https://ua1.us"&gt;UA1 Labs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>showdev</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
