From f7161c34cbd45d87124ad25cf06d3ff57e3bc23f Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 20 Apr 2012 23:11:53 +0200 Subject: reenabled romanization test The test can be skipped by excluding the "slow" group. --- _test/tests/inc/httpclient_http.test.php | 45 ++++++++++++++++++++++++++++--- _test/tests/inc/utf8_romanize.cputest.php | 36 ------------------------- _test/tests/inc/utf8_romanize.test.php | 37 +++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 39 deletions(-) delete mode 100644 _test/tests/inc/utf8_romanize.cputest.php create mode 100644 _test/tests/inc/utf8_romanize.test.php (limited to '_test/tests') diff --git a/_test/tests/inc/httpclient_http.test.php b/_test/tests/inc/httpclient_http.test.php index 3857273f7..9cae3736a 100644 --- a/_test/tests/inc/httpclient_http.test.php +++ b/_test/tests/inc/httpclient_http.test.php @@ -1,11 +1,11 @@ get($this->server.'/get?foo=bar'); @@ -16,6 +16,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals(array('foo'=>'bar'), $resp['args']); } + /** + * @group internet + */ function test_dget(){ $http = new HTTPClient(); $data = $http->dget($this->server.'/get',array('foo'=>'bar')); @@ -26,6 +29,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals(array('foo'=>'bar'), $resp['args']); } + /** + * @group internet + */ function test_gzip(){ $http = new HTTPClient(); $data = $http->get($this->server.'/gzip'); @@ -36,6 +42,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertTrue($resp['gzipped']); } + /** + * @group internet + */ function test_simplepost(){ $http = new HTTPClient(); $data = $http->post($this->server.'/post',array('foo'=>'bar')); @@ -46,6 +55,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals(array('foo'=>'bar'), $resp['form']); } + /** + * @group internet + */ function test_redirect(){ $http = new HTTPClient(); $data = $http->get($this->server.'/redirect/3'); @@ -56,6 +68,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertRegExp('/\/get$/', $resp['url']); } + /** + * @group internet + */ function test_relredirect(){ $http = new HTTPClient(); $data = $http->get($this->server.'/relative-redirect/3'); @@ -66,6 +81,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertRegExp('/\/get$/', $resp['url']); } + /** + * @group internet + */ function test_redirectfail(){ $http = new HTTPClient(); $data = $http->get($this->server.'/redirect/5'); @@ -73,6 +91,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals('Maximum number of redirects exceeded',$http->error); } + /** + * @group internet + */ function test_cookies(){ $http = new HTTPClient(); $http->get($this->server.'/cookies/set/foo/bar'); @@ -85,6 +106,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals(array('foo'=>'bar'), $resp['cookies']); } + /** + * @group internet + */ function test_teapot(){ $http = new HTTPClient(); $data = $http->get($this->server.'/status/418'); @@ -92,6 +116,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals(418,$http->status); } + /** + * @group internet + */ function test_maxbody(){ $http = new HTTPClient(); $http->max_bodysize = 250; @@ -99,6 +126,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertTrue($data === false, 'HTTP response'); } + /** + * @group internet + */ function test_basicauth(){ $http = new HTTPClient(); $http->user = 'user'; @@ -110,6 +140,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals(array('authenticated'=>true,'user'=>'user'), $resp); } + /** + * @group internet + */ function test_basicauthfail(){ $http = new HTTPClient(); $http->user = 'user'; @@ -119,6 +152,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals(401,$http->status); } + /** + * @group internet + */ function test_timeout(){ $http = new HTTPClient(); $http->timeout = 5; @@ -127,6 +163,9 @@ class httpclient_http_test extends DokuWikiTest { $this->assertEquals(-100,$http->status); } + /** + * @group internet + */ function test_headers(){ $http = new HTTPClient(); $data = $http->get($this->server.'/response-headers?baz=&foo=bar'); diff --git a/_test/tests/inc/utf8_romanize.cputest.php b/_test/tests/inc/utf8_romanize.cputest.php deleted file mode 100644 index 66e3b76c9..000000000 --- a/_test/tests/inc/utf8_romanize.cputest.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - function test_japanese(){ - $tests = file(dirname(__FILE__).'/utf8_kanaromaji.txt'); - $line = 1; - foreach($tests as $test){ - list($jap,$rom) = explode(';',trim($test)); - - $chk = utf8_romanize($jap); - #if($chk != $rom) echo "$jap\t->\t$chk\t!=\t$rom\t($line)\n"; - $this->assertEquals($chk,$rom); - $line++; - } - } - - /** - * Test romanization of character that would usually be deaccented in a different - * way FS#1117 - * - * @author Andreas Gohr - */ - function test_deaccented(){ - $this->assertEquals("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö")); - } -} -//Setup VIM: ex: et ts=4 : diff --git a/_test/tests/inc/utf8_romanize.test.php b/_test/tests/inc/utf8_romanize.test.php new file mode 100644 index 000000000..d08346faa --- /dev/null +++ b/_test/tests/inc/utf8_romanize.test.php @@ -0,0 +1,37 @@ + + */ + function test_japanese(){ + $tests = file(dirname(__FILE__).'/utf8_kanaromaji.txt'); + $line = 1; + foreach($tests as $test){ + list($jap,$rom) = explode(';',trim($test)); + + $chk = utf8_romanize($jap); + $this->assertEquals($rom,$chk,"$jap\t->\t$chk\t!=\t$rom\t($line)"); + $line++; + } + } + + /** + * Test romanization of character that would usually be deaccented in a different + * way FS#1117 + * + * @author Andreas Gohr + */ + function test_deaccented(){ + $this->assertEquals("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö")); + } +} +//Setup VIM: ex: et ts=4 : -- cgit v1.2.3