From: Antoine Musso Date: Thu, 27 Oct 2011 10:28:25 +0000 (+0000) Subject: we must have a session when testing Api upload. X-Git-Tag: 1.31.0-rc.0~26884 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=7f2e429c17da4db5e1ed3e9001420f03b5127551;p=lhc%2Fweb%2Fwiklou.git we must have a session when testing Api upload. For some reason, the ApiUploadTest::testLogin method no more returns a valid session. Since most, if not all, of the ApiUploadTest tests depends on it we want that testLogin method to fail so we can skip the rest of the tests. Test command: ./phpunit.php --filter ApiUpload --tap BEFORE: ======= TAP version 13 array(0) { } ok 1 - ApiUploadTest::testLogin ok 2 - ApiUploadTest::testUploadRequiresToken not ok 3 - Error: ApiUploadTest::testUploadMissingParams not ok 4 - Error: ApiUploadTest::testUpload ^C AFTER: ====== TAP version 13 not ok 1 - Failure: ApiUploadTest::testLogin --- message: 'API Login must return a session' severity: fail ... ok 1 - # SKIP This test depends on "ApiUploadTest::testLogin" to pass. ok 1 - # SKIP This test depends on "ApiUploadTest::testLogin" to pass. ^C ... more skips --- diff --git a/tests/phpunit/includes/api/ApiUploadTest.php b/tests/phpunit/includes/api/ApiUploadTest.php index 1e22d20dee..f5b3b1fb42 100644 --- a/tests/phpunit/includes/api/ApiUploadTest.php +++ b/tests/phpunit/includes/api/ApiUploadTest.php @@ -54,6 +54,7 @@ class ApiUploadTest extends ApiTestCaseUpload { $this->assertEquals( "Success", $result['login']['result'] ); $this->assertArrayHasKey( 'lgtoken', $result['login'] ); + $this->assertNotEmpty( $session, 'API Login must return a session' ); return $session; }