Setup PHPUnit and created on sample test by using WP CLI Plugin Unit Tests. https://github.com/wp-cli/wp-cli/wiki/Plugin-Unit-Tests