From 84e603aa91a303a1419962ff3ff6086710a7b1a9 Mon Sep 17 00:00:00 2001 From: Mark Pemberton Date: Sat, 4 Jun 2011 00:29:04 -0400 Subject: Reverted changes of date() to gdate(), added tests to confirm existence of private RSS feed, and finalized changes to the user session usage with rss.php --- tests/TestBaseApi.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'tests/TestBaseApi.php') diff --git a/tests/TestBaseApi.php b/tests/TestBaseApi.php index 20574f3..d8917aa 100644 --- a/tests/TestBaseApi.php +++ b/tests/TestBaseApi.php @@ -164,15 +164,16 @@ class TestBaseApi extends TestBase * * Useful for testing HTML pages or ajax URLs. * - * @param string $urlSuffix Suffix for the URL - * @param mixed $auth If user authentication is needed (true/false) - * or array with username and password + * @param string $urlSuffix Suffix for the URL + * @param mixed $auth If user authentication is needed (true/false) + * or array with username and password + * @param boolean $privateKey True if to add user with private key * * @return array(HTTP_Request2, integer) HTTP request object and user id * * @uses getRequest() */ - protected function getLoggedInRequest($urlSuffix = null, $auth = true) + protected function getLoggedInRequest($urlSuffix = null, $auth = true, $privateKey = false) { if (is_array($auth)) { list($username, $password) = $auth; @@ -180,7 +181,13 @@ class TestBaseApi extends TestBase $username = 'testuser'; $password = 'testpassword'; } - $uid = $this->addUser($username, $password); + //include privatekey if requested + if ($privateKey) { + $pKey = $this->us->getNewPrivateKey(); + } else { + $pKey = null; + } + $uid = $this->addUser($username, $password, $pKey); $req = new HTTP_Request2( $GLOBALS['unittestUrl'] . '/login.php?unittestMode=1', @@ -234,7 +241,7 @@ class TestBaseApi extends TestBase */ protected function setUnittestConfig($arConfig) { - $str = '<' . "?php\r\n"; + $str = '<' . "?php\n"; foreach ($arConfig as $name => $value) { $str .= '$' . $name . ' = ' . var_export($value, true) . ";\n"; @@ -253,4 +260,4 @@ class TestBaseApi extends TestBase ); } } -?> \ No newline at end of file +?> -- cgit v1.2.3