diff --git a/developer_manual/core/unit-testing.rst b/developer_manual/core/unit-testing.rst index 3fb7b7320..745436b72 100644 --- a/developer_manual/core/unit-testing.rst +++ b/developer_manual/core/unit-testing.rst @@ -35,37 +35,51 @@ Then you can simply run the created test with phpunit. An example for a simple test would be: -:file:`/srv/http/owncloud/apps/myapp/tests/testsuite.php` +:file:`/srv/http/owncloud/apps/myapp/tests/testaddtwo.php` .. code-block:: php - assertEquals(5, addTwo(3)); - } + protected function setUp() { + parent::setUp(); + $this->testMe = new \OCA\Myapp\TestMe(); + } - } - ?> + public function testAddTwo(){ + $this->assertEquals(5, $this->testMe->addTwo(3)); + } -:file:`/srv/http/owncloud/apps/myapp/tests/testsuite.php` + } + + +:file:`/srv/http/owncloud/apps/myapp/lib/testme.php` .. code-block:: php - +