UndefinedOffset/silverstripe-codebank

Test suites

Closed this issue · 2 comments

Should add automated testing with phpunit and behat via travis-ci

Need to add tests for the following methods:

CodeBankSnippets::saveSnippet()
CodeBankSnippets::deleteSnippet()
CodeBankSnippets::packageRemoveSnippet()
CodeBankSnippets::addSnippetToPackage()
CodeBankSnippets::savePackage()
CodeBankSnippets::createPackage()
CodeBankSnippets::deletePackage()
CodeBankSnippets::newFolder()
CodeBankSnippets::renameFolder()
CodeBankSnippets::deleteFolder()
CodeBankSnippets::moveSnippet()

Should we add unit tests for the rest of the methods in CodeBankSnippets such as searching (as well as the auto complete), and other read methods?

After some adjustments to the tests (29883bb and 3d43821) builds are now passing on all but PostgreSQL databases https://travis-ci.org/UndefinedOffset/silverstripe-codebank/builds/24463430. We should probably address that but that will be another issue.

Unfortunately due to travis-ci not having a web server, the api endpoint test is disabled 3d43821. It would be a shame to install apache for just one test case, but should the build be switched to php 5.4 and use the built in web server for this test or just leave it omitted?