Add phpunit tests

This commit is contained in:
brantje 2016-10-07 20:55:17 +02:00
parent b28688e972
commit 76991470be
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
2 changed files with 6 additions and 9 deletions

View file

@ -38,6 +38,8 @@ before_install:
- nvm install 5.9
- npm install -g npm@latest
- npm install grunt-cli -g
#
before_script:
# - if [[ "$DB" == 'pgsql' ]]; then createuser -U travis -s oc_autotest; fi
@ -45,6 +47,8 @@ before_script:
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
- cd apps/$APP_NAME/
- mkdir -p build
- curl -sSL https://phar.phpunit.de/phpunit.phar -o build/phpunit.phar
- npm install
# - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
# - ./occ app:enable passman
@ -52,7 +56,8 @@ before_script:
script:
- grunt jshint
- php build/phpunit.phar -c phpunit.xml
- php build/phpunit.phar -c phpunit.integration.xml
#after_failure:
# - cat ../../data/owncloud.log

View file

@ -37,12 +37,4 @@ class PageControllerTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('main', $result->getTemplateName());
$this->assertTrue($result instanceof TemplateResponse);
}
public function testEcho() {
$result = $this->controller->doEcho('hi');
$this->assertEquals(['echo' => 'hi'], $result->getData());
}
}