@TheBlasfem
Write your tests, then write code to make your test pass and finally refactor your functional code
Dependency Manager for PHP
$ composer create-project wp-cli/wp-cli --no-dev
http://wp-cli.org/
A command line interface for WordPress
$ wp scaffold plugin demo
http://phpunit.de/
Testing framework for PHP
setUp() method is run just before each and every test method.
tearDown() is run just after each and every test method.
setUpBeforeClass() and tearDownAfterClass() are called before the first test and after the last test, respectively.
Pass Test
Failed asserting that an array contains 4
Failed asserting that 0 matches expected 1
A Wordpress's plugin to setting up posts as test data
Failed assert: Undefined index: factory-women
Pass Test
Failed assert: call to undefined method insert_posts()
Pass Test
Failed asserting that 0 matches expected 5
Pass Test
Failed asserting that ' ' contains "prueba"
Pass Test