diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/phpunit-pgsql.xml | 33 | ||||
-rw-r--r-- | tests/unit/get_tags_test.php | 17 |
2 files changed, 22 insertions, 28 deletions
diff --git a/tests/phpunit-pgsql.xml b/tests/phpunit-pgsql.xml index 078056d56..8b11aae31 100644 --- a/tests/phpunit-pgsql.xml +++ b/tests/phpunit-pgsql.xml @@ -1,24 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.0/phpunit.xsd" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd" bootstrap="../boot.php" forceCoversAnnotation="false" beStrictAboutCoversAnnotation="true" beStrictAboutOutputDuringTests="true" beStrictAboutTodoAnnotatedTests="true" verbose="true"> - <testsuite name="Hubzilla default Test Suite"> - <directory suffix="Test.php">./unit/</directory> - </testsuite> - <testsuite name="API Test Suite"> - <directory suffix="Test.php" prefix="API">./unit/</directory> - </testsuite> + <testsuites> + <testsuite name="Hubzilla default Test Suite"> + <directory suffix="Test.php">./unit/</directory> + </testsuite> + <testsuite name="API Test Suite"> + <directory suffix="Test.php" prefix="API">./unit/</directory> + </testsuite> + </testsuites> <groups> <exclude> <group>mysql</group> </exclude> </groups> - <!--cover reporting--> + <!--coverage reporting--> <filter> <whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">../Zotlabs/</directory> @@ -26,21 +28,22 @@ </whitelist> </filter> <logging> - <log type="junit" target="./results/junit.xml" logIncompleteSkipped="false"/> - <log type="coverage-clover" target="./results/coverage-clover.xml"/> + <log type="junit" target="./results/junit.xml"/> + <!--<log type="coverage-clover" target="./results/coverage-clover.xml"/>--> <log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35" highLowerBound="70"/> - <log type="testdox-text" target="./results/testdox.txt"/> + <!--<log type="testdox-text" target="./results/testdox.txt"/>--> + <log type="testdox-html" target="./results/testdox.html"/> </logging> <php> <!-- Default test database config, only used if no environment variables with same names are set. !!! Never run against a real database, it will truncate all tables --> - <env name="hz_db_server" value="127.0.0.1"/> + <env name="hz_db_server" value="postgres"/> <env name="hz_db_scheme" value="pgsql"/> <env name="hz_db_port" value="5432"/> - <env name="hz_db_user" value="travis_hz"/> - <env name="hz_db_pass" value="hubzilla"/> - <env name="hz_db_database" value="travis_hubzilla"/> + <env name="hz_db_user" value="ci-user"/> + <env name="hz_db_pass" value="ci-pass"/> + <env name="hz_db_database" value="ci-db"/> </php> </phpunit> diff --git a/tests/unit/get_tags_test.php b/tests/unit/get_tags_test.php index 40f016747..bdffd8311 100644 --- a/tests/unit/get_tags_test.php +++ b/tests/unit/get_tags_test.php @@ -106,10 +106,9 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $tags=get_tags($text);
- $inform=''; $str_tags=''; foreach($tags as $tag) { - handle_tag($this->a, $text, $inform, $str_tags, 11, $tag); + handle_tag($text, $str_tags, 11, $tag); } //correct tags found? @@ -117,7 +116,6 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $this->assertTrue(in_array("@Mike", $tags)); //correct output from handle_tag? - $this->assertEquals("cid:15", $inform); $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags); $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url]", $text);
} @@ -135,9 +133,8 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1, count($tags));
$this->assertTrue(in_array("@Mike.because", $tags)); - $inform='';
$str_tags='';
- handle_tag($this->a, $text, $inform, $str_tags, 11, $tags[0]);
+ handle_tag($text, $str_tags, 11, $tags[0]);
// (mike) - This is a tricky case. // we support mentions as in @mike@example.com - which contains a period. @@ -149,7 +146,6 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { // $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags); // $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url].because", $text);
- $this->assertEquals("", $inform); $this->assertEquals("", $str_tags); } @@ -195,13 +191,11 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $this->assertTrue(in_array("@Mike This", $tags));
$this->assertTrue(in_array("#test_case", $tags));
- $inform=''; $str_tags=''; foreach($tags as $tag) { - handle_tag($this->a, $text, $inform, $str_tags, 11, $tag); + handle_tag($text, $str_tags, 11, $tag); } - $this->assertEquals("cid:15", $inform); $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url],#[url=baseurl/search?tag=test%20case]test case[/url]", $str_tags); $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url] This is a #[url=baseurl/search?tag=test%20case]test case[/url]", $text); @@ -255,16 +249,13 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { //happens right now, but it shouldn't be necessary $this->assertTrue(in_array("@mike+15 id", $tags)); - $inform='';
$str_tags=''; foreach($tags as $tag) { - handle_tag($this->a, $text, $inform, $str_tags, 11, $tag); + handle_tag($text, $str_tags, 11, $tag); } $this->assertEquals("Test with @[url=http://justatest.de]Mike Lastname[/url] id tag", $text);
$this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags);
- // this test may produce two cid:15 entries - which is OK because duplicates are pruned before delivery - $this->assertContains("cid:15",$inform); } /** |