Skip to content

Commit

Permalink
init phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
Henni committed Nov 25, 2015
1 parent ca07435 commit 9cac24f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 104 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ script:
- sh -c "if [ '$DB' = 'sqlite' ]; then ant test; fi"

# Run phpunit tests
- cd tests/unit
- phpunit --configuration phpunit.xml

# Create coverage report
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Additionally it is possible to display (and search for) contacts and gpx/gps tra
## Running tests
After [Installing PHPUnit](http://phpunit.de/getting-started.html) run:

phpunit tests/
phpunit

##Sources
- OpenLayers https://github.com/openlayers/openlayers
Expand Down
26 changes: 25 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
<phpunit bootstrap="tests/autoloader.php"></phpunit>
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="../../tests/bootstrap.php"
verbose="true"
timeoutForSmallTests="900"
timeoutForMediumTests="900"
timeoutForLargeTests="900"
>
<testsuite name='ownCloud - Maps App Tests'>
<directory suffix='test.php'>tests</directory>
</testsuite>
<!-- filters for code coverage -->
<filter>
<whitelist>
<directory suffix=".php">.</directory>
<exclude>
<directory suffix=".php">l10n</directory>
<directory suffix=".php">tests</directory>
</exclude>
</whitelist>
</filter>
<logging>
<!-- and this is where your report will be written -->
<log type="coverage-clover" target="./clover.xml"/>
</logging>
</phpunit>
52 changes: 0 additions & 52 deletions tests/autoloader.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function setUp () {
$this->container = $app->getContainer();
}


public function testIndex () {
// swap out request
$this->container['Request'] = $this->getMockBuilder('\OCP\IRequest')
Expand All @@ -37,17 +36,9 @@ public function testIndex () {

$result = $this->container['PageController']->index();

$this->assertEquals(array('user' => 'john'), $result->getParams());
$this->assertEquals(array('user' => 'john', 'devices' => []), $result->getParams());
$this->assertEquals('main', $result->getTemplateName());
$this->assertTrue($result instanceof TemplateResponse);
}


public function testEcho () {
$result = $this->container['PageController']->doEcho('hi');

$this->assertEquals(array('echo' => 'hi'), $result);
}


}
}
11 changes: 0 additions & 11 deletions tests/unit/bootstrap.php

This file was deleted.

27 changes: 0 additions & 27 deletions tests/unit/phpunit.xml

This file was deleted.

0 comments on commit 9cac24f

Please sign in to comment.