Deprecated: Return type of aae\dispatch\receiver\ReiceiverAbstract::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/dispatch/receiver/ReiceiverAbstract.php on line 29

Deprecated: Return type of aae\dispatch\receiver\ReiceiverAbstract::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/dispatch/receiver/ReiceiverAbstract.php on line 35

Deprecated: Return type of aae\dispatch\receiver\ReiceiverAbstract::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/dispatch/receiver/ReiceiverAbstract.php on line 22

Deprecated: Return type of aae\dispatch\receiver\ReiceiverAbstract::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/dispatch/receiver/ReiceiverAbstract.php on line 32

Deprecated: Creation of dynamic property aae\ui\ResourceManagerDynamic::$_varResolver is deprecated in /home/protected/src/aae/ui/ResourceManagerDynamic.php on line 17

Deprecated: Return type of aae\ui\Template::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/ui/Template.php on line 164

Deprecated: Return type of aae\ui\Template::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/ui/Template.php on line 170

Deprecated: Return type of aae\ui\Template::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/ui/Template.php on line 160

Deprecated: Return type of aae\ui\Template::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/ui/Template.php on line 167

Deprecated: Creation of dynamic property aae\ui\DefaultErrorViewController::$_localizer is deprecated in /home/protected/src/aae/ui/ViewController.php on line 20

Deprecated: Creation of dynamic property aae\ui\Application::$_api is deprecated in /home/protected/src/aae/ui/Application.php on line 14

Deprecated: Creation of dynamic property aae\ui\Application::$_serializer is deprecated in /home/protected/src/aae/ui/Application.php on line 15

Deprecated: Creation of dynamic property aae\ui\Application::$_errorViewController is deprecated in /home/protected/src/aae/ui/Application.php on line 16

Deprecated: Return type of aae\dispatch\callProtocol\ControllerActionArgs::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/protected/src/aae/dispatch/callProtocol/ControllerActionArgs.php on line 46

Deprecated: Creation of dynamic property aae\ui\ResourceManagerDynamic::$_varResolver is deprecated in /home/protected/src/aae/ui/ResourceManagerDynamic.php on line 17

Deprecated: Creation of dynamic property aae\ui\MarkdownViewController::$_localizer is deprecated in /home/protected/src/aae/ui/ViewController.php on line 20

Deprecated: Creation of dynamic property aae\ui\Markdown::$paragraphOpenTag is deprecated in /home/protected/src/aae/ui/Markdown.php on line 22

Deprecated: Creation of dynamic property aae\ui\Markdown::$paragraphCloseTag is deprecated in /home/protected/src/aae/ui/Markdown.php on line 23

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagOpen is deprecated in /home/protected/src/aae/ui/Markdown.php on line 711

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagClose is deprecated in /home/protected/src/aae/ui/Markdown.php on line 712

Deprecated: Creation of dynamic property aae\ui\ListType::$listRegexIdentifyer is deprecated in /home/protected/src/aae/ui/Markdown.php on line 713

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagOpen is deprecated in /home/protected/src/aae/ui/Markdown.php on line 711

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagClose is deprecated in /home/protected/src/aae/ui/Markdown.php on line 712

Deprecated: Creation of dynamic property aae\ui\ListType::$listRegexIdentifyer is deprecated in /home/protected/src/aae/ui/Markdown.php on line 713

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagOpen is deprecated in /home/protected/src/aae/ui/Markdown.php on line 711

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagClose is deprecated in /home/protected/src/aae/ui/Markdown.php on line 712

Deprecated: Creation of dynamic property aae\ui\ListType::$listRegexIdentifyer is deprecated in /home/protected/src/aae/ui/Markdown.php on line 713

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagOpen is deprecated in /home/protected/src/aae/ui/Markdown.php on line 711

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagClose is deprecated in /home/protected/src/aae/ui/Markdown.php on line 712

Deprecated: Creation of dynamic property aae\ui\ListType::$listRegexIdentifyer is deprecated in /home/protected/src/aae/ui/Markdown.php on line 713

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagOpen is deprecated in /home/protected/src/aae/ui/Markdown.php on line 711

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagClose is deprecated in /home/protected/src/aae/ui/Markdown.php on line 712

Deprecated: Creation of dynamic property aae\ui\ListType::$listRegexIdentifyer is deprecated in /home/protected/src/aae/ui/Markdown.php on line 713

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagOpen is deprecated in /home/protected/src/aae/ui/Markdown.php on line 711

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagClose is deprecated in /home/protected/src/aae/ui/Markdown.php on line 712

Deprecated: Creation of dynamic property aae\ui\ListType::$listRegexIdentifyer is deprecated in /home/protected/src/aae/ui/Markdown.php on line 713

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagOpen is deprecated in /home/protected/src/aae/ui/Markdown.php on line 711

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagClose is deprecated in /home/protected/src/aae/ui/Markdown.php on line 712

Deprecated: Creation of dynamic property aae\ui\ListType::$listRegexIdentifyer is deprecated in /home/protected/src/aae/ui/Markdown.php on line 713

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagOpen is deprecated in /home/protected/src/aae/ui/Markdown.php on line 711

Deprecated: Creation of dynamic property aae\ui\ListType::$listTagClose is deprecated in /home/protected/src/aae/ui/Markdown.php on line 712

Deprecated: Creation of dynamic property aae\ui\ListType::$listRegexIdentifyer is deprecated in /home/protected/src/aae/ui/Markdown.php on line 713
AAE

Axel Ancona Esselmann


San Francisco, CA Axel@AnconaEsselmann.com LinkedIn www.anconaesselmann.com

LiveUnit


A Sublime Text plug-in for continuous running of unit tests.

View on GitHub

View a demo of LiveUnit:

Overview


gif of live unit testing php

Requirements:

Unit testing with PHP requires PHPUnit.

Setting up Live Unit Testing

Live Unit Testing with PHP requires a PSR-0 compliant autoloader that gets included inside the test file.

If you don't have your own autoloader, download phpAutoloader. If you create test files with LiveUnit, your autoloader can be included automatically, if you specify the autoloader path in the settings file:

Sublime Text->Preferences->Package Settings->ClassesAndTest->Settings - User

Add the setting php_autoloader_path. Provide a relative path that starts at the namespace root directory.

Example:

You have the following folder structure:

/MyProject
/MyProject/src
/MyProject/srcTest

The namespaced name of you autoloader is:

\aae\autoload\AutoLoader

PSR-0 requires you to place the autoloader in in the folder /MyProject/src/aae/autoloader, so your setting for php_autoloader_path is:

{
"php_autoloader_path": "aae/autoload/AutoLoader.php"
}

Now, when you create new class and test files with LiveUnit, the autoloader is included in the test file.

gif of class and test being created

Known issues:

When using the Live Unit Testing feature, be careful with infinite loops. Currently the only way to escape an infinite loop is to quit Sublime text. I suggest disabling Live Unit Testing whenever there is a possibility that unfinished code might be evaluated as an infinite loop.

This page was rendered with MyMark, a Markdown flavor developed by Axel Ancona Esselmann. View the original file here.